Massive CPU Load Due to PHP

tehelgee

Member
I run a Xenforo forum that gets about 60-120 users at a time, depending on time of day. And after the first day of running the forum, servers loads have being extremely high: spiking up to 16 on a 4 core system at times. The memory shows about 60% use at max, so it's not a problem there.

Using top in ssh shows the problem to be php. It constitutes the majority of the high cpu load processes.

What can i do to help alleviate this problem?

I'm a complete noob at running a VPS, btw, so please answer in layman's terms.
 
Yeah, it's just my single site on the VPS.

And I'm willing to try just about anything to fix this problem. How will I go about installing DSO? Or do I contact my provider and ask them to do it?
 
DSO is packaged with WHM, just select it on the Configure PHP and suEXEC page.

AJIZ3Uq.png
 
Oh, okay.

Now, before I do anything with it, the page you linked me to earlier said that permissions are more fiddly with DSO. Will the permissions set themselves, or will I? Because if I need to, I'd like you(or anyone) to help me figure that out before I do anything.

Like I mentioned earlier, it's just one website running on the VPS, and that's all I ever foresee there being. The forum is the entire point of it, after all.
 
I've had no problems switching between suPHP and DSO before with 2 sites on the server.
It's possible that your VPS simply isn't powerful enough too. How many vcores and how much ram?
 
That's more than adequate.
You can try FastCGI first if you like, it uses the same file permissions and ownership as suPHP. If it doesn't work, just switch back.
 
Update on that: apparently during the reboot, the server failed to reboot. Provider tech couldn't get it to reboot properly either. Provider admin will be looking into it now.

/me just has no luck.
 
Well, back again after the provider has looked over things.

The VPS has been rebooted and is back online now.

After checking the top process, I see that the scripts under the user geryona were consuming more resources on the server causing the problem. Please see the details pasted below.
------------------------
root@geryvps [~]#
root 1661 0.0 0.2 104560 4404 ? Ss 16:42 0:00 sshd: geryona [priv]
geryona 1695 0.0 0.1 104560 2016 ? S 16:42 0:00 sshd: geryona@pts/1
geryona 1696 0.0 0.1 108304 1884 pts/1 Ss 16:42 0:00 -bash
geryona 1856 0.0 0.2 60440 3772 pts/1 S+ 16:43 0:00 ssh root@localhost -p 8833
geryona 2553 0.0 0.1 23320 2668 ? S 16:47 0:00 dovecot/imap
geryona 2561 0.0 0.1 23300 2412 ? S 16:48 0:00 dovecot/imap
geryona 2657 0.0 0.1 23316 2416 ? S 16:48 0:00 dovecot/imap
geryona 3119 0.0 0.1 23264 2428 ? S 16:52 0:00 dovecot/imap
geryona 3238 0.0 0.1 23264 2432 ? S 16:52 0:00 dovecot/imap
geryona 3333 0.0 0.1 23264 2428 ? S 16:53 0:00 dovecot/imap
geryona 3933 11.1 1.6 294132 25164 ? S< 17:01 0:38 /usr/bin/php
geryona 3937 14.4 1.4 287572 22736 ? S< 17:01 0:50 /usr/bin/php
geryona 4030 9.6 1.3 287576 20652 ? S< 17:02 0:24 /usr/bin/php
geryona 4259 8.7 1.2 287344 18344 ? S< 17:04 0:15 /usr/bin/php
geryona 4352 3.6 1.5 290032 22988 ? S< 17:04 0:05 /usr/bin/php
geryona 4354 5.1 1.5 290032 23008 ? S< 17:04 0:07 /usr/bin/php
geryona 4533 15.3 1.6 294124 24920 ? R< 17:05 0:14 /usr/bin/php
geryona 4534 3.9 1.3 288112 20668 ? S< 17:05 0:03 /usr/bin/php
geryona 4535 13.3 1.2 288296 19288 ? S< 17:05 0:12 /usr/bin/php
geryona 4536 7.9 1.3 288296 21260 ? S< 17:05 0:07 /usr/bin/php
geryona 4537 9.9 1.3 290032 20920 ? S< 17:05 0:09 /usr/bin/php
geryona 4561 25.9 1.6 294600 25392 ? R< 17:05 0:21 /usr/bin/php
root 4844 0.0 0.0 103248 884 pts/3 S<+ 17:06 0:00 grep root@geryv
---------------------------------
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
php 4533 geryona cwd DIR 8,3 4096 1447508 /home/geryona/forum
php 4533 geryona rtd DIR 8,3 4096 2 /
php 4533 geryona txt REG 8,3 34802495 23197 /usr/bin/php
php 4533 geryona mem REG 8,3 65928 2684 /lib64/libnss_files-2.12.so
php 4533 geryona mem REG 8,3 95533 547675 /usr/local/lib/php/extensions/no-debug-non-zts-20100525/ixed.5.4.lin
php 4533 geryona mem REG 8,3 1413524 547684 /usr/local/lib/php/extensions/no-debug-non-zts-20100525/rar.so
php 4533 geryona mem REG 8,3 216576 29314 /usr/lib64/libGeoIP.so.1.5.1
php 4533 geryona mem REG 8,3 59086 547682 /usr/local/lib/php/extensions/no-debug-non-zts-20100525/geoip.so
php 4533 geryona mem REG 8,3 127792 15512 /usr/lib64/libyaml-0.so.2.0.4
php 4533 geryona mem REG 8,3 219998 547676 /usr/local/lib/php/extensions/no-debug-non-zts-20100525/yaml.so
php 4533 geryona mem REG 8,3 52209 547397 /usr/local/lib/php/extensions/no-debug-non-zts-20100525/uploadprogress.so
php 4533 geryona mem REG 8,3 263681 547396 /usr/local/lib/php/extensions/no-debug-non-zts-20100525/pdo_mysql.so
php 4533 geryona mem REG 8,3 2592291 547399 /usr/local/lib/php/extensions/no-debug-non-zts-20100525/pdo_sqlite.so
php 4533 geryona mem REG 8,3 345884 547398 /usr/local/lib/php/extensions/no-debug-non-zts-20100525/pdo.so
-----------------------------------------------------
root@geryvps [~]#
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
php 3937 geryona cwd DIR 8,3 4096 1440648 /home/geryona/public_html
php 3937 geryona rtd DIR 8,3 4096 2 /
php 3937 geryona txt REG 8,3 34802495 23197 /usr/bin/php
php 3937 geryona mem REG 8,3 65928 2684 /lib64/libnss_files-2.12.so
php 3937 geryona mem REG 8,3 95533 547675 /usr/local/lib/php/extensions/no-debug-non-zts-20100525/ixed.5.4.lin
php 3937 geryona mem REG 8,3 1413524 547684 /usr/local/lib/php/extensions/no-debug-non-zts-20100525/rar.so
php 3937 geryona mem REG 8,3 216576 29314 /usr/lib64/libGeoIP.so.1.5.1
php 3937 geryona mem REG 8,3 59086 547682 /usr/local/lib/php/extensions/no-debug-non-zts-20100525/geoip.so
php 3937 geryona mem REG 8,3 127792 15512 /usr/lib64/libyaml-0.so.2.0.4
php 3937 geryona mem REG 8,3 219998 547676 /usr/local/lib/php/extensions/no-debug-non-zts-20100525/yaml.so
php 3937 geryona mem REG 8,3 52209 547397 /usr/local/lib/php/extensions/no-debug-non-zts-20100525/uploadprogress.so
php 3937 geryona mem REG 8,3 263681 547396 /usr/local/lib/php/extensions/no-debug-non-zts-20100525/pdo_mysql.so
php 3937 geryona mem REG 8,3 2592291 547399 /usr/local/lib/php/extensions/no-debug-non-zts-20100525/pdo_sqlite.so
php 3937 geryona mem REG 8,3 345884 547398 /usr/local/lib/php/extensions/no-debug-non-zts-20100525/pdo.so
php 3937 geryona mem REG 8,3 14288 3802 /lib64/libgpg-error.so.0.5.0
php 3937 geryona mem REG 8,3 66608 3930 /usr/lib64/libtasn1.so.3.1.6
php 3937 geryona mem REG 8,3 23208 16462 /usr/lib64/libogg.so
-------------------------------------------------------
I would suggest you enable you to optimize the scripts with the help of a developer or you need upgrade the resource on the server.
Please feel free to let me know if you have any more questions.

This is what they pointed out. Any ideas?
 
This is like anti-performance.

Don't use this.


Something is trying to send a lot of email for some reason (the 6 dovecot proceses), and you are using suPHP. fixing both of these will likely resolve your problems.

Oh, hey Xon.

Anyway, with the assistance of a much more IT knowledgeable member of my forum, we switched to FastCGI and a reinstall was done with the old database imported into the new install. And, all the problems seem to have gone away.

So, it doesn't seem like it was a configuration issue, it was probably something I did during installation.

@alethiophile is pure magic, I'm telling you.
 
Back
Top Bottom