Go Back   vb.org Archive > vBulletin 4 Discussion > vB4 General Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 12-19-2014, 05:54 PM
ilove2rock ilove2rock is offline
 
Join Date: Dec 2010
Posts: 13
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Issues with excessive CPU usage continue...

Hi Everyone,

We recently received some help with the my.cnf file from vB.com and this did seem to help alot, but still we have a lingering issue.

Previously we had to restart the site everyday to keep things running, now its more like every 6 - 10 days. We've not been able to isolate what is causing the excess CPU usage.

I recently installed a proper firewall on the server so I am now receiving email messages which are much more revealing. Here is a typical email that starts 6 - 10 days after a reboot.


Quote:
Usernetrock PID:2338 PPID:2177 Run Time:93615(secs) Memory:171232(kb) exe:/usr/bin/php cmd:/usr/bin/php /home/pnetrock/public_html/cron.php
Usernetrock PID:2408 PPID:2020 Run Time:176408(secs) Memory:171072(kb) exe:/usr/bin/php cmd:/usr/bin/php /home/pnetrock/public_html/cron.php
Usernetrock PID:2436 PPID:1028 Run Time:136691(secs) Memory:171072(kb) exe:/usr/bin/php cmd:/usr/bin/php /home/pnetrock/public_html/cron.php
Usernetrock PID:2491 PPID:2176 Run Time:50384(secs) Memory:171072(kb) exe:/usr/bin/php cmd:/usr/bin/php /home/pnetrock/public_html/cron.php
Usernetrock PID:3330 PPID:3278 Run Time:10856(secs) Memory:171232(kb) exe:/usr/bin/php cmd:/usr/bin/php /home/pnetrock/public_html/cron.php
Usernetrock PID:4946 PPID:4815 Run Time:172725(secs) Memory:171072(kb) exe:/usr/bin/php cmd:/usr/bin/php /home/pnetrock/public_html/cron.php
Usernetrock PID:4975 PPID:4096 Run Time:133195(secs) Memory:171072(kb) exe:/usr/bin/php cmd:/usr/bin/php /home/pnetrock/public_html/cron.php
Usernetrock PID:5426 PPID:5289 Run Time:90067(secs) Memory:171232(kb) exe:/usr/bin/php cmd:/usr/bin/php /home/pnetrock/public_html/cron.php
Usernetrock PID:5659 PPID:5615 Run Time:46853(secs) Memory:171076(kb) exe:/usr/bin/php cmd:/usr/bin/php /home/pnetrock/public_html/cron.php
Usernetrock PID:6494 PPID:6396 Run Time:7249(secs) Memory:171232(kb) exe:/usr/bin/php cmd:/usr/bin/php /home/pnetrock/public_html/cron.php
Usernetrock PID:7471 PPID:7104 Run Time:129657(secs) Memory:171072(kb) exe:/usr/bin/php cmd:/usr/bin/php /home/pnetrock/public_html/cron.php
Usernetrock PID:7672 PPID:7593 Run Time:43250(secs) Memory:171072(kb) exe:/usr/bin/php cmd:/usr/bin/php /home/pnetrock/public_html/cron.php
Usernetrock PID:7741 PPID:6693 Run Time:169171(secs) Memory:171076(kb) exe:/usr/bin/php cmd:/usr/bin/php /home/pnetrock/public_html/cron.php
Usernetrock PID:8216 PPID:7930 Run Time:86276(secs) Memory:170816(kb) exe:/usr/bin/php cmd:/usr/bin/php /home/pnetrock/public_html/cron.php
Usernetrock PID:9472 PPID:9235 Run Time:3570(secs) Memory:170976(kb) exe:/usr/bin/php cmd:/usr/bin/php /home/pnetrock/public_html/cron.php
Usernetrock PID:9883 PPID:8086 Run Time:165668(secs) Memory:171076(kb) exe:/usr/bin/php cmd:/usr/bin/php /home/pnetrock/public_html/cron.php
Usernetrock PID:10137 PPID:10020 Run Time:126022(secs) Memory:171072(kb) exe:/usr/bin/php cmd:/usr/bin/php /home/pnetrock/public_html/cron.php
Usernetrock PID:10882 PPID:10421 Run Time:39665(secs) Memory:171072(kb) exe:/usr/bin/php cmd:/usr/bin/php /home/pnetrock/public_html/cron.php
Usernetrock PID:10925 PPID:10763 Run Time:82827(secs) Memory:171076(kb) exe:/usr/bin/php cmd:/usr/bin/php /home/pnetrock/public_html/cron.php
Usernetrock PID:12401 PPID:11789 Run Time:122449(secs) Memory:170820(kb) exe:/usr/bin/php cmd:/usr/bin/php /home/pnetrock/public_html/cron.php
Usernetrock PID:13147 PPID:12830 Run Time:62(secs) Memory:171232(kb) exe:/usr/bin/php cmd:/usr/bin/php /home/pnetrock/public_html/cron.php
Usernetrock PID:13489 PPID:13245 Run Time:161994(secs) Memory:171072(kb) exe:/usr/bin/php cmd:/usr/bin/php /home/pnetrock/public_html/cron.php
Usernetrock PID:14273 PPID:14227 Run Time:78918(secs) Memory:171076(kb) exe:/usr/bin/php cmd:/usr/bin/php /home/pnetrock/public_html/cron.php
Usernetrock PID:14362 PPID:13663 Run Time:35705(secs) Memory:170976(kb) exe:/usr/bin/php cmd:/usr/bin/php /home/pnetrock/public_html/cron.php
Usernetrock PID:14820 PPID:14476 Run Time:118772(secs) Memory:171156(kb) exe:/usr/bin/php cmd:/usr/bin/php /home/pnetrock/public_html/cron.php
Usernetrock PID:16696 PPID:15578 Run Time:158468(secs) Memory:171076(kb) exe:/usr/bin/php cmd:/usr/bin/php /home/pnetrock/public_html/cron.php
Usernetrock PID:16945 PPID:16386 Run Time:32246(secs) Memory:171232(kb) exe:/usr/bin/php cmd:/usr/bin/php /home/pnetrock/public_html/cron.php
Usernetrock PID:17112 PPID:16686 Run Time:75653(secs) Memory:171072(kb) exe:/usr/bin/php cmd:/usr/bin/php /home/pnetrock/public_html/cron.php
Usernetrock PID:18224 PPID:18101 Run Time:115114(secs) Memory:171072(kb) exe:/usr/bin/php cmd:/usr/bin/php /home/pnetrock/public_html/cron.php
Usernetrock PID:18921 PPID:18902 Run Time:28850(secs) Memory:171076(kb) exe:/usr/bin/php cmd:/usr/bin/php /home/pnetrock/public_html/cron.php
Usernetrock PID:19398 PPID:19188 Run Time:154836(secs) Memory:171076(kb) exe:/usr/bin/php cmd:/usr/bin/php /home/pnetrock/public_html/cron.php
Usernetrock PID:19623 PPID:18914 Run Time:71875(secs) Memory:171076(kb) exe:/usr/bin/php cmd:/usr/bin/php /home/pnetrock/public_html/cron.php
Usernetrock PID:21824 PPID:21557 Run Time:68351(secs) Memory:171072(kb) exe:/usr/bin/php cmd:/usr/bin/php /home/pnetrock/public_html/cron.php
Usernetrock PID:23251 PPID:21275 Run Time:151167(secs) Memory:171076(kb) exe:/usr/bin/php cmd:/usr/bin/php /home/pnetrock/public_html/cron.php
Usernetrock PID:23397 PPID:19880 Run Time:111582(secs) Memory:171072(kb) exe:/usr/bin/php cmd:/usr/bin/php /home/pnetrock/public_html/cron.php
Usernetrock PID:24233 PPID:24178 Run Time:64868(secs) Memory:170816(kb) exe:/usr/bin/php cmd:/usr/bin/php /home/pnetrock/public_html/cron.php
Usernetrock PID:24409 PPID:24187 Run Time:25119(secs) Memory:171232(kb) exe:/usr/bin/php cmd:/usr/bin/php /home/pnetrock/public_html/cron.php
Usernetrock PID:25988 PPID:24681 Run Time:107711(secs) Memory:171232(kb) exe:/usr/bin/php cmd:/usr/bin/php /home/pnetrock/public_html/cron.php
Usernetrock PID:26326 PPID:25862 Run Time:147210(secs) Memory:170816(kb) exe:/usr/bin/php cmd:/usr/bin/php /home/pnetrock/public_html/cron.php
Usernetrock PID:27041 PPID:25830 Run Time:21564(secs) Memory:170820(kb) exe:/usr/bin/php cmd:/usr/bin/php /home/pnetrock/public_html/cron.php
Usernetrock PID:27268 PPID:26513 Run Time:61116(secs) Memory:171076(kb) exe:/usr/bin/php cmd:/usr/bin/php /home/pnetrock/public_html/cron.php
Usernetrock PID:27937 PPID:27346 Run Time:103986(secs) Memory:171232(kb) exe:/usr/bin/php cmd:/usr/bin/php /home/pnetrock/public_html/cron.php
Usernetrock PID:28650 PPID:28306 Run Time:144025(secs) Memory:171072(kb) exe:/usr/bin/php cmd:/usr/bin/php /home/pnetrock/public_html/cron.php
Usernetrock PID:29244 PPID:28796 Run Time:183627(secs) Memory:171076(kb) exe:/usr/bin/php cmd:/usr/bin/php /home/pnetrock/public_html/cron.php
Usernetrock PID:29555 PPID:29530 Run Time:18069(secs) Memory:171232(kb) exe:/usr/bin/php cmd:/usr/bin/php /home/pnetrock/public_html/cron.php
Usernetrock PID:29810 PPID:29539 Run Time:57671(secs) Memory:171076(kb) exe:/usr/bin/php cmd:/usr/bin/php /home/pnetrock/public_html/cron.php
Usernetrock PID:29958 PPID:29415 Run Time:100669(secs) Memory:170976(kb) exe:/usr/bin/php cmd:/usr/bin/php /home/pnetrock/public_html/cron.php
Usernetrock PID:31842 PPID:31814 Run Time:140444(secs) Memory:171072(kb) exe:/usr/bin/php cmd:/usr/bin/php /home/pnetrock/public_html/cron.php
Usernetrock PID:31958 PPID:30620 Run Time:14462(secs) Memory:171232(kb) exe:/usr/bin/php cmd:/usr/bin/php /home/pnetrock/public_html/cron.php
Usernetrock PID:32018 PPID:31495 Run Time:180016(secs) Memory:171072(kb) exe:/usr/bin/php cmd:/usr/bin/php /home/pnetrock/public_html/cron.php
Usernetrock PID:32378 PPID:31616 Run Time:54046(secs) Memory:170816(kb) exe:/usr/bin/php cmd:/usr/bin/php /home/pnetrock/public_html/cron.php
Usernetrock PID:32517 PPID:32393 Run Time:97093(secs) Memory:170976(kb) exe:/usr/bin/php cmd:/usr/bin/php /home/pnetrock/public_html/cron.php
It seems to me that it is a cron job that is hanging up and causing all the problems.

How can I isolate which cron job? I am willing to pay someone to fix this problem.

Thanks in advance for any advice
Reply With Quote
  #2  
Old 12-19-2014, 07:00 PM
RichieBoy67's Avatar
RichieBoy67 RichieBoy67 is offline
 
Join Date: Apr 2004
Location: CT - Down in a hole..
Posts: 3,057
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Is there no time stamp in the log? Just match it with your cron tasks. Chances are it is something major like a database back up or sitemap gen, something like that.
Reply With Quote
  #3  
Old 12-19-2014, 07:40 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

If you're willing to pay someone to figure it out, you should post a request in the Request for Paid Services forum.

If you're feeling adventurous, you could try editing your includes/functions_cron.php file like this (find this section near the end and replace it with this):
PHP Code:
    if ($nextitem)
    {
        if (
$nextrun build_cron_item($nextitem['cronid'], $nextitem))
        {
            if ((
$fp fopen('cronlog.txt''a')) !== NULL)
            {
               
fwrite($fpdate(DATE_ATOM)." PID:".getmypid()." start '".$nextitem['filename']."'\n");
               
fclose($fp);
            }
            
$time_start microtime(true);
            include_once(
DIR '/' $nextitem['filename']);
            
$t microtime(true) - $time_start;
            if ((
$fp fopen('cronlog.txt''a')) !== NULL)
            {
               
fwrite($fpdate(DATE_ATOM)." PID:".getmypid()."   end '".$nextitem['filename']."', run time $t\n");
               
fclose($fp);
            }
        }
    }
    else
    {
        
build_cron_next_run();
    } 

then after a while you hopefully can look at cronlog.txt and find the tasks that aren't ending. Of course you'll still have to figure out why, but at least you'll know where to look.
Reply With Quote
  #4  
Old 12-19-2014, 08:39 PM
Max Taxable's Avatar
Max Taxable Max Taxable is offline
 
Join Date: Feb 2011
Posts: 3,134
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Go through all your scheduled tasks, turning off those you feel you don't need. See if that helps.

If not and ff you can do without the scheduled tasks completely, turn them off one at a time for a few days until you find the one causing the issue.
Reply With Quote
  #5  
Old 12-19-2014, 11:44 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I find it odd there is no timestamp on the errors. If you can get the errors to print with a timestamp, then you can take a look at your Scheduled Tasks and see which one(s) correspond with that timestamp.
Reply With Quote
  #6  
Old 12-20-2014, 03:56 PM
ilove2rock ilove2rock is offline
 
Join Date: Dec 2010
Posts: 13
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

ok Thank you all for your replies, I have added the above script so I will post results when I get a few

What directory will I find cronlog.txt?

Thanks again, Lisa
Reply With Quote
  #7  
Old 12-20-2014, 05:06 PM
Seven Skins's Avatar
Seven Skins Seven Skins is offline
 
Join Date: Sep 2008
Location: London, UK
Posts: 1,481
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

To turn them off go to: AdminCP > Scheduled Tasks > Scheduled Task Manager > then from controls on the right (drop down) of the tasks disable them.
Reply With Quote
  #8  
Old 12-20-2014, 05:52 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by ilove2rock View Post
What directory will I find cronlog.txt?
It should be in the main forum directory (the one with forum.php).

I made a change to the code after I posted it (I forgot that microtime() needed a parameter to return a number instead of string). So hopefully you copied the code after I made that change, or else the run times will be wrong. It may not matter though, because for the times you posted above it looks like you have things hanging around for days, so you should be able to see that without the run times.
Reply With Quote
  #9  
Old 12-20-2014, 06:02 PM
ilove2rock ilove2rock is offline
 
Join Date: Dec 2010
Posts: 13
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thank you KH99

I did just paste the info in a couple of hours ago.

I've found the forum.php directory and there is only cron.php. I cant find the log file. Do I have to create an empty document?
Reply With Quote
  #10  
Old 12-20-2014, 06:10 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Oh, yeah, I'm so used to doing stuff on my test forum that I didn't think of the fact that your web server user might not have permission to create files in that directory. So yeah, you could try creating the empty file.

Another option would be to change the path to somewhere (outside your html directory) where a file can be created. I really should have made the file path a variable, but I didn't so there's two places where it would need to be changed.

It could also be that no scheduled tasks have run yet. For some reason it doesn't log if you use the "Run Now" button the Scheduled Task manager. I guess it uses different code to run the tasks.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 12:16 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04329 seconds
  • Memory Usage 2,292KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)bbcode_php
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete