Multiple httpd & php processes
-
I have a Pfsense 2.1 with 2Ghz Intel Dual core, 2GB ram handling 80-100 computers with squid 3.3.10 v2.2.6 and qlproxy and sarg
I observe my memory usage rising every day.
It starts from 28% on fresh boot and increases by 20% every day, until the 5th day it reaches 93% and squid and qlproxy crash with " icap protocol error" I am posting my top output at a point when memory usage is reported at 76% and at this point there is no traffic and no computers online.
why does the memory usage not come down when there is no traffic of computers using the firewall?
why are there multiple httpd and php processes using high RAM?top screen shot attached
-
Hmm… your question seems vaguely familiar. ;)
Be sure that you have logging enabled to help you find this problem: Services: Proxy server: General settings: Logging Settings: Enabled logging
Other than the ICAP errors, what are you seeing that leads you to suspect the memory? Are there memory related errors in Status: System logs: General? (i.e. out of swap space, memory exhausted, unable to create, etc.) Is squid reporting any errors in it's logs? (in Services: Proxy server: Realtime) FreeBSD normally handles it's memory utilization quite well, so if we aren't seeing actual memory errors anywhere I would suspect some other issue.
I've seen reports this issue can be related to file descriptors. Just curious, what is the output of this command?
squidclient mgr:info | grep descriptorwhy does the memory usage not come down when there is no traffic of computers using the firewall?
why are there multiple httpd and php processes using high RAM?Regarding the memory utilization, Squid's job is to cache so it's going to cache as much as possible within the limits you specify in it's configuration. It's not unusual to see it using memory and disk space to do it's caching.
The php processes look normal to me. pfSense is written in php so it's not surprising to see it running.
The httpd processes are unusual. If you've provided a complete list of installed packages then I'd guess they must be related to qlproxy?
-
Thanks for the reply,
it seems I am on the trail to pinpoint the reason for "icap protocol error".
looking at the dashboard I realised that there was NO SWAP, I manually enabled SWAP by issuing "swapon"
But after a reboot again no SWAP, I once again had to start in manually, now it is SIX days the memory utilisation hovers between 83% to 90% and swap between 6% to 13%…also my manually turning ON SWAP shows only 2048mb SWAP on 2048mb Ram, normally on other systems I have noticed double the swap memory..Now two queries- How do I ensure SWAP turns ON on every reboot
- How do I change size of swap from 2048mb to 4096mb
My hDD is 80Gb, 74Gb reported by Pfsense
The first partition is 70Gb, so I believe I have 4096mb for swap. -
- How do I ensure SWAP turns ON on every reboot
- How do I change size of swap from 2048mb to 4096mb
Make swap permanent by adding it to /etc/fstab. Something like:
#/dev/label/swap0 none swap sw 0 0Ref. https://www.freebsd.org/doc/handbook/adding-swap-space.html
To increase the size of the swap you will need to repartition the disk or create a "swap file" (see link above) and add it to fstab as above.
https://forum.pfsense.org/index.php?topic=78519.msg429186#msg429186