News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

Cron Job problem or what?

Started by geezmo, March 19, 2009, 06:41:53 AM

Previous topic - Next topic

geezmo

For the past 5 days now, my forum has been suspended everyday by my host supposedly because it uses too much CPU resources (I'm on VPS). Interestingly, the suspension usually occurs around 5 p.m. my time.

I'm thinking the forum is probably doing a cron job during this hour or whatever it is it's doing during this time that's causing the server load to go up. My question is, how would I know what these cron jobs are or whatever the forum is doing at this particular time?

Aleksi "Lex" Kilpinen

Suspended because of high cpu usage on a VPS? Who's your host?
And did they provide any logs or anything to prove their claim?
Slava
Ukraini!
"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum. Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

How you can help SMF

geezmo

This is what they sent me. Have absolutely no idea what exactly this means that's why I can't solve what's causing the high CPU usage.

===================================================
-bash-3.00# pstree | grep http
|-httpd-+-9*[httpd---2*[php]]
| |-66*[httpd]
| |-23*[httpd---php]
| |-3*[httpd---suexec]
| |-httpd---php---host
| |-httpd---php---sh
| |-2*[httpd-+-php]


-bash-3.00# w
04:51:21 up 8 days, 23:08, 0 users, load average: 52.88, 49.59, 33.06
USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT

-bash-3.00# ps -auwx | grep php | sort -n
Warning: bad syntax, perhaps a bogus '-'? See /usr/share/doc/procps-3.2.3/FAQ
root 26313 0.0 0.0 1600 524 ttyp0 S+ 04:51 0:00 grep php
root 26506 0.0 0.0 3728 292 ? D 04:51 0:00 /usr/local/apache/bin/suexec vpsaccount vpsaccount index.php
vpsaccount 2017 0.1 0.0 0 0 ? Z 04:49 0:00 [php] <defunct>
vpsaccount 3195 0.4 0.0 0 0 ? Z 04:49 0:00 [php] <defunct>
vpsaccount 3255 0.4 0.0 0 0 ? Z 04:49 0:00 [php] <defunct>
vpsaccount 3356 0.5 0.0 0 0 ? Z 04:49 0:00 [php] <defunct>
vpsaccount 3395 0.4 0.0 0 0 ? Z 04:49 0:00 [php] <defunct>
vpsaccount 3502 0.6 3.9 56800 20824 ? R 04:49 0:00 /usr/bin/php index.php
vpsaccount 3546 0.5 0.0 0 0 ? Z 04:49 0:00 [php] <defunct>
vpsaccount 3739 0.6 0.0 0 0 ? Z 04:49 0:00 [php] <defunct>
vpsaccount 3743 0.4 0.0 0 0 ? Z 04:49 0:00 [php] <defunct>
vpsaccount 3809 0.5 3.7 56092 19400 ? R 04:49 0:00 /usr/bin/php index.php
vpsaccount 3863 0.4 0.0 0 0 ? Z 04:49 0:00 [php] <defunct>
vpsaccount 9867 0.4 0.0 0 0 ? Z 04:50 0:00 [php] <defunct>
vpsaccount 10139 0.1 0.0 0 0 ? Z 04:44 0:00 [php] <defunct>
vpsaccount 13691 0.4 2.4 54836 12796 ? S 04:50 0:00 /usr/bin/php index.php
vpsaccount 17451 0.7 0.0 0 0 ? Z 04:50 0:00 [php] <defunct>
vpsaccount 17511 0.8 3.9 56588 20496 ? R 04:50 0:00 /usr/bin/php index.php
vpsaccount 18012 0.2 0.0 0 0 ? Z 04:45 0:00 [php] <defunct>
vpsaccount 19849 0.8 3.8 56348 19960 ? D 04:50 0:00 /usr/bin/php index.php
vpsaccount 21728 1.2 0.0 0 0 ? Z 04:50 0:00 [php] <defunct>
vpsaccount 22319 0.9 3.7 56092 19528 ? R 04:50 0:00 /usr/bin/php index.php
vpsaccount 22472 1.2 3.9 56660 20608 ? D 04:50 0:00 /usr/bin/php index.php
vpsaccount 22491 1.0 3.8 56340 19956 ? R 04:50 0:00 /usr/bin/php index.php
vpsaccount 22501 1.3 0.0 0 0 ? Z 04:50 0:00 [php] <defunct>
vpsaccount 23621 1.2 3.7 56092 19404 ? D 04:50 0:00 /usr/bin/php index.php
vpsaccount 23624 1.5 4.0 56876 21020 ? D 04:50 0:00 /usr/bin/php index.php
vpsaccount 23625 1.4 3.9 56876 20964 ? R 04:50 0:00 /usr/bin/php index.php
vpsaccount 23626 1.4 3.9 56876 20852 ? R 04:50 0:00 /usr/bin/php index.php
vpsaccount 23631 1.1 3.7 56088 19444 ? R 04:50 0:00 /usr/bin/php index.php
vpsaccount 23656 0.6 2.4 52208 12824 ? D 04:50 0:00 /usr/bin/php index.php
vpsaccount 23662 0.6 2.4 52348 13016 ? D 04:50 0:00 /usr/bin/php index.php
vpsaccount 23667 0.4 1.7 50152 9432 ? D 04:50 0:00 /usr/bin/php index.php
vpsaccount 23676 0.0 0.0 4048 100 ? D 04:50 0:00 /usr/bin/php index.php
vpsaccount 23691 0.1 1.1 48384 6048 ? D 04:50 0:00 /usr/bin/php index.php
vpsaccount 23698 0.6 2.2 51580 11956 ? D 04:50 0:00 /usr/bin/php index.php
vpsaccount 23702 0.4 1.8 50428 9624 ? D 04:50 0:00 /usr/bin/php index.php
vpsaccount 23714 0.4 1.7 50300 9336 ? D 04:50 0:00 /usr/bin/php index.php
vpsaccount 23747 0.1 1.1 48264 5900 ? D 04:50 0:00 /usr/bin/php index.php
vpsaccount 23763 0.5 1.8 50412 9924 ? D 04:50 0:00 /usr/bin/php index.php
vpsaccount 23783 0.7 2.2 51788 11792 ? D 04:50 0:00 /usr/bin/php index.php
vpsaccount 23850 0.9 2.4 52212 12800 ? R 04:50 0:00 /usr/bin/php index.php
vpsaccount 23857 0.4 1.6 50200 8752 ? D 04:50 0:00 /usr/bin/php index.php
vpsaccount 23871 0.4 1.6 49968 8580 ? D 04:50 0:00 /usr/bin/php index.php
vpsaccount 23958 1.1 2.1 51624 11512 ? D 04:50 0:00 /usr/bin/php index.php
vpsaccount 23965 0.9 1.8 50276 9752 ? D 04:50 0:00 /usr/bin/php index.php
vpsaccount 24009 0.0 0.3 13036 1828 ? D 04:50 0:00 /usr/bin/php index.php
vpsaccount 24103 1.2 1.6 50292 8840 ? D 04:50 0:00 /usr/bin/php index.php
vpsaccount 24129 0.0 0.0 10032 420 ? D 04:50 0:00 /usr/bin/php index.php
vpsaccount 24209 0.8 1.1 48268 5936 ? D 04:51 0:00 /usr/bin/php index.php
vpsaccount 24316 2.0 1.5 49360 8244 ? D 04:51 0:00 /usr/bin/php index.php
vpsaccount 24468 0.2 0.2 13040 1548 ? D 04:51 0:00 /usr/bin/php index.php
vpsaccount 24488 0.2 0.2 13040 1544 ? D 04:51 0:00 /usr/bin/php index.php
vpsaccount 25653 0.0 0.0 9608 388 ? D 04:51 0:00 /usr/bin/php index.php
vpsaccount 25798 0.0 0.0 0 0 ? Z 04:47 0:00 [php] <defunct>
vpsaccount 25890 1.0 1.0 47864 5372 ? D 04:51 0:00 /usr/bin/php index.php
vpsaccount 25920 0.0 0.0 8600 356 ? D 04:51 0:00 /usr/bin/php index.php
======================================================


A day before that, this is the report they emailed me:

======================================================

Your account is constantly causing resource abuse in your VPS due to excessive php threads, this is effecting the performance of other VPSs running in the same node. Please check the current load details below.

======================================================
root@vps [/]# w
03:40:26 up 9 days, 21:57, 0 users, load average: 75.45, 39.79, 17.20
USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT

More details are in the file /abuse.tx in your VPS

root@vps [/]# ls -al /abuse.txt
-rw-r--r-- 1 root root 9236 Mar 18 03:48 /abuse.txt
======================================================

Kenny01


Something like that

Install APC to cut your CPU usage by a third.

Kenny01

Quote from: Phalloidium on March 19, 2009, 07:05:15 PM
Install APC to cut your CPU usage by a third.

Is APC better than memcache?
because i'm planning to install memcache in my server.

Something like that

Quote from: Kenny01 on March 20, 2009, 12:51:09 AM
Quote from: Phalloidium on March 19, 2009, 07:05:15 PM
Install APC to cut your CPU usage by a third.

Is APC better than memcache?
because i'm planning to install memcache in my server.

Depends. APC does two things. Memcache does just one.

APC cached compiled PHP scripts -- saving a step, and cutting CPU usage a lot. APC can also cache user variables with SMF. That lightens the load on the database a lot and makes things faster. Memcache only stores user variables. APC is limited to the serving PHP process. Memcache can work across multiple machines (and also many processes).

Kenny01

I understand that this forum is using memcache because APC keep blocking the forum after some time.

Something like that

Quote from: Kenny01 on March 20, 2009, 01:10:23 AM
I understand that this forum is using memcache because APC keep blocking the forum after some time.

APC works perfectly fine. I've been using it for almost two years, and it's been ROCK SOLID the entire time. I've never had a single issue with it.

Kenny01

Thanks man, i'm going for memcache.

Vekseid

Memcached is slower than APC+Query Cache on a system calling MySQL through a socket.

That said, geezmo, are you using standard cgi and not mod_fcgid?
Adult Role Playing Forums - - Over five million posts - - Elliquiy's LAMP configuration (maybe NSFW)

Blog about Forums and Servers - - Twenty things to make Simple Machines Forum go faster

Private/Instant Message requests for free support will be ignored.

diegolyanky

#11
Only my opinion ...

Today, is more rentable a Dedicated Server than a VPS ...

Virtual Dedicated Servers, has many VPS inside ... And, you are sharing too many components.

In ( example ) LiquidWeb yo can have your own dedicated server ( REALLY IT'S DEDICATED ) and can customize all and everything for only U$D 149 / month.

More info here: LIQUIDWEB DEDICATED SERVERS

Test it ;)


Edit: Removed referral portion of link. - Motoko-chan
SMF ... SimpleMachines ... Simple, but complete if you want it ;)

Something like that

Or you can get a Dedicated Server at iWeb.com for 69/mn USD. I have a few with them and I'm extremely satisfied.

Kenny01

I'm already on a dedicated server, the memcache is for future use not now, because by sites are running fine.

Tyrsson

Is this issue solved or do you still require assistance?
PM at your own risk, some I answer, if they are interesting, some I ignore.

Kenny01

Quote from: Phalloidium on March 22, 2009, 08:19:02 PM
Or you can get a Dedicated Server at iWeb.com for 69/mn USD. I have a few with them and I'm extremely satisfied.
My host just installed memcache free on my server on request.

Something like that

Quote from: Kenny01 on April 25, 2009, 09:39:50 AM
Quote from: Phalloidium on March 22, 2009, 08:19:02 PM
Or you can get a Dedicated Server at iWeb.com for 69/mn USD. I have a few with them and I'm extremely satisfied.
My host just installed memcache free on my server on request.

Just make sure that it's not listening on your live internet IP. Other than that, you should see a big improvement :)

Kenny01

What do you mean by listening on your live internet IP?

Actually my site is faster now and it's no more locking queries, but my memory usage increase from 30% to 40%.

Something like that

For instance, this website is on 207.210.95.101. That's its live IP.

All machines also have an internal IP, 127.0.0.1, that's inaccessible from the outside. That's the only one you want memcached listening on.

It'll be in its configuration file.

Kenny01

and what happens if it's listening to the live IP?

Tyrsson

That could possibly give access to someone outside of the server.
PM at your own risk, some I answer, if they are interesting, some I ignore.

Kenny01

These are professionals, they know what they're doing, because they do it for a living.

Tyrsson

@geezmo

Is this solved or do you require further assistance with this?
PM at your own risk, some I answer, if they are interesting, some I ignore.

Advertisement: