# determine the memory used by each (PHP-FPM) child process



## fred974 (Nov 8, 2016)

Hi I tried to man adapt the command bellow for FreeBSD but so far I haven't managed to get it working..
`ps -ylC php-fpm --sort:rss`

Could someone please help me to convert it in a way that FreeBSD understand?

I am trying to determine the memory used by each (PHP-FPM) child process to adjust my PHP-FPM setting for my php7 installation

```
pm.max_children =
pm.start_servers =
pm.min_spare_servers =
pm.max_spare_servers =
pm.max_requests =
```

Thank you


----------



## kalleboy (Nov 1, 2021)

Got the same question, for the same command if anyone could answer..
Either for: 

`ps -eo size,pid,user,command --sort -size | awk '{ hr=$1/1024 ; printf("%13.2f Mb ",hr) } { for ( x=4 ; x&lt;=NF ; x++ ) { printf("%s ",$x) } print "" }' | grep php-fpm`

or:
`ps --no-headers -o "rss,cmd" -C php-fpm | awk '{ sum+=$1 } END { printf ("%d%s\n", sum/NR/1024,"M") }'`

equivalent of *BSD.


----------



## Alain De Vos (Nov 1, 2021)

show resident and virtual memory : 

```
ps xao rss,vsz,command | grep php
```


----------



## kalleboy (Nov 2, 2021)

Thank you so much Alain.


----------

