Long CPU usage spikes on PHP processes in standard WebGUI
-
I'm running pfSense in VMWare on a ridiculously low spec computer, a 600MHz Celeron with 320mb RAM running a super-stripped version of Windows XP. I opted to post this here instead of the VMware forums because it occurs while running a real system as well.
Here's the basic problem at hand. Lots of stuff is running in the background, but watch for the two "php" processes to hit the top of the list.
Idle (just running a few torrents and whatever the other people in my apartment complex are doing):
Shortly after loading /index.php:
After loading a small page like firewall_nat.php:
Now, this problem had occurred before for me. When I was using my old 600MHz Athlon system, I had pfSense running natively, and I installed Samba, MySQL, the MySQL PHP library, and TorrentFlux. That required me to run several commands each time I rebooted (inetd, stopall lighttpd, ee /usr/local/lib/php.ini, lighttpd -f /var/etc/lighty-webConfigurator.conf), and it sucked. The funny thing is, after using PHP for loading a TorrentFlux page, loading the next WebUI page took a very long time no matter what page it was. Also, the more processes (torrents) I had running - and since I seed for a private tracker, that means a LOT of torrents and no traffic - the longer it took to load each page. It wasn't paging/swapping, as there was no unusual disk activity. It was crunching something… that might be a clue. =)
I just wouldn't think the WebGUI pages would take up so much more CPU time than the firewall itself... y'know? :)
-
Some of the guipages (like index.php or queues.php) are dynamically updating. This might cause some performance impact on lower end hardware. Not sure if you run the dashboard package but this will add some more overhead as well. Haven't seen that on non low end hardware though. On the other hand I agree that there might be some room for improvement by tweaking some webserver settings.
I created a ticket for this some time ago so we will revisit this before 1.2.1 gets released. In the meanwhile feel free to tweak the file by hand like shown here: http://cvstrac.pfsense.org/chngview?cn=16999
$opcode_cacher .= "apc.shm_size="8"\n";
The red number being the cache in MB. From our tests in the past you have to find the best setting as a too low number will cause the webgui to be pretty slow but even a too hogh number seems to have a negative affect. Feel free to post the best setting that you found out for your system. Note that you have to reboot the system after changing that file (you can do so easily from the webgui using diagnostics>edit file).