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

Reply
 
Thread Tools Display Modes
  #1  
Old 03-06-2008, 01:46 PM
MrEyes MrEyes is offline
 
Join Date: Nov 2004
Posts: 380
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Some advice relating to hosting

Hello all,

I am currently experiencing some problems with my vBulletin server host, and the answers I am getting back from support just don't seem to add up. Not being an expert on these things I need some advice before I start ranting and end up being made to look stupid.

I run a fairly popular forum, average user/guests online is ~120 during normal hours (7am to 1am), dropping to ~5 during early morning hours (1am -> 7am). My current stats are:
  • Most users ever online was 170, 26-02-08 at 16:04.
  • Threads: 5,162
  • Posts: 116,632
  • Members: 1,245
  • Posts per day: 116,632 / 90 = ~1295
  • Threads per day: 5,162 / 90 = ~57

(Division by 90 as the forum is only 3 months old)

I also run the following mods/changes:
  • Custom template changes to display Adsense for all logged out users and threads over 15 days old
  • Arcade (70 games)
  • Casino
  • vBulletin Blog
  • vBadvanced CMPS

So nothing out of the ordinary there.

Now all this runs on a Linux VPS server with the following relevant setup:
  • Disk Space : 15gb (I currently use 24% of this)
  • Monthly Bandwidth : 300gb (I currently use ~2.5 gb a day, so I am 75% under the cap)
  • Guaranteed Ram : 384mb
  • Burstable Ram : 1gb

So that’s the background, on to the actual problem...

Since setting up the server a few months ago, early morning users have reported that they occasionally get the following error:

Quote:
Fatal error: Out of memory (allocated 786432) (tried to allocate 1966080 bytes) in /home/primarysite/public_html/XXXX on line YYYY
Where XXXX is a random page within the site and YYYY is a random line number. Also the "allocated" and "allocate" numbers are obviously different on each error report.

In the last few days I have started to receive the same report from users who are on the site during normal hours. This tends to happen for 5 to 10 minutes and then the problem disappears for a few days and then comes back.

At face value the cause of this seems obvious, the VPS is running out of memory and moving to a higher specced VPS package will resolve this.

However...

The numbers here just don't add up. Let me explain, this error has been reported (by users) at:
  • 5th March 2008 @ ~8pm (GMT) - At this time there were ~100 users/guests online.
  • [numerous dates] @ ~1am to ~3am (GMT) - Typically at this time there are no more than 5 users/guests online.

However, the site has been working fine at:
  • 26th February 2008 @ 16:04 - At this time there were 170 users/guests online. This is around 60% load more than when the server failed on the 5th, and around 98% more than the early morning outages.
  • [most days] @ ~10am -> ~4pm) - Average users/guests online is around 120 (at the time of writing there are 111).

If this was the "face value" memory issue I would not have expected the server to be able to handle the additional load of the 26th February, or the average daily load and would expect it to easy handle the load during early morning hours. However this is not the case which is why I say that the numbers do not add up.

I have to admit that I am no VPS expert, however I am not aware of any cron jobs or processes running at these times, also after reviewing server logs there have been numerous incidents of privvmpages hitting alert levels at the time these reports occur

In addition to this, until setting up the VPS account at the beginning of February 08 this site was running on a no bells and whistles $10 a month shared hosting package and was handling the load without any problems. The reason for moving to VPS was that I have plans to start attracting more users and did not want the community to experience outages. These "plans" are not yet in place so the load currently being placed on the VPS is near as dammit the same load as I was placing on the shared hosting package. I would have expected the VPS to hold up a lot better considering that it is almost 5 times more expensive. I realise that VPS and Shared hosting are two entirely different things, but I am sure you understand where I am coming from when I say that this VPS should be able to handle the same load, and more, than a two bit shared hosting package.

Now all this has been reported to the host and they seem to have ignored the “just doesn’t add up” part and gone down the route of “shared isn’t VPS” (fair enough) and “you will have to upgrade”. They also suggested that the ~5 users at 1am were somehow generating more server load than the 170 that the server coped with only a few days ago. This is a response that I am not entirely happy with, however as mentioned above I need to get my facts straight before going back and ranting at them. I am also more than happy to be told here (as you are independent) that the host is right and I am killing the server with load (although it would be nice to see how these numbers add up).

I realise that one solution would be to find a better host, but I would rather not go there unless absolutely necessary as I don’t want to put the community through another server upheaval after only having done one 5 weeks ago.

So, if you are still with me thanks for reading this far, do you have any suggestions/ideas/comments?
Reply With Quote
  #2  
Old 03-06-2008, 03:10 PM
snakes1100 snakes1100 is offline
 
Join Date: Dec 2001
Location: Michigan
Posts: 3,733
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Whats your memory limit set at in php.ini?

As i dont know your time zone, typically most server crons run late night at those times you posted, did you check all the cron dirs in etc and inspect each cron file for the times they are running?
Reply With Quote
  #3  
Old 03-06-2008, 07:28 PM
MrEyes MrEyes is offline
 
Join Date: Nov 2004
Posts: 380
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

The resource configs in the php.ini file are:

Quote:
max_execution_time = 30
max_input_time = 60
memory_limit = 32M
As far as timezone goes I am in GMT and so is the server. Running the "crontab -e" command gives me:

Quote:

0 1 * * * /scripts/cpbackup
*/15 * * * * /usr/local/cpanel/whostmgr/bin/dnsqueue > /dev/null 2>&1
2,58 * * * * /usr/local/bandmin/bandmin
0 0 * * * /usr/local/bandmin/ipaddrmap
14 0 * * * /usr/local/cpanel/whostmgr/docroot/cgi/cpaddons_report.pl --notify
0 6 * * * /scripts/exim_tidydb > /dev/null 2>&1
*/5 * * * * /usr/local/cpanel/bin/dcpumon >/dev/null 2>&1
checking /etc/cron* gives me:

Quote:
[root@vps etc]# ls cron*
cron.deny crontab

cron.d:
sysstat

cron.daily:
00-makewhatis.cron logrotate rpm slocate.cron tmpwatch yum.cron

cron.hourly:

cron.monthly:

cron.weekly:
00-makewhatis.cron yum.cron
However I am not sure how to check the exact times these items run at

So there we have it, I don't think there is anything out of the ordinary
Reply With Quote
  #4  
Old 03-07-2008, 05:38 AM
Dismounted's Avatar
Dismounted Dismounted is offline
 
Join Date: Jun 2005
Location: Melbourne, Australia
Posts: 15,047
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

PHP seems to be running out of memory. This is probably caused by too many scripts running at the same time. I see a backup script being run, maybe this is causing the issue. The temporary fix would be to increase the memory limit.
Reply With Quote
  #5  
Old 03-07-2008, 09:00 AM
snakes1100 snakes1100 is offline
 
Join Date: Dec 2001
Location: Michigan
Posts: 3,733
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

The front part of each line is the time at which these are set to run

Code:
0 1 * * * /scripts/cpbackup
*/15 * * * * /usr/local/cpanel/whostmgr/bin/dnsqueue > /dev/null 2>&1
2,58 * * * * /usr/local/bandmin/bandmin
0 0 * * * /usr/local/bandmin/ipaddrmap
14 0 * * * /usr/local/cpanel/whostmgr/docroot/cgi/cpaddons_report.pl --notify
0 6 * * * /scripts/exim_tidydb > /dev/null 2>&1
*/5 * * * * /usr/local/cpanel/bin/dcpumon >/dev/null 2>&1
minute 1-60 hour 0-23 Day of the Month 1-31 the month 1-12 the weekday 0-7

Basically at this point with cpanel as your host panel, you now have a bunch of scripts being ran, if you look at the 1st & 2nd asterisks you will note one is running every 15 minutes, as with your old vhost, they probably had that server set with a larger memory_limit as well. You could tweak the cron times that they run or update the memory_limit
Reply With Quote
  #6  
Old 03-07-2008, 09:52 AM
MrEyes MrEyes is offline
 
Join Date: Nov 2004
Posts: 380
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Dismounted View Post
The temporary fix would be to increase the memory limit.
I have to admit that I do not fully understand the problem, however the VPS is capping out the max memory that it is able to use at an OS level, rather than PHP itself running out of allocated memory. So would changing the PHP memory cap actually do anything to resolve this.

To be honest I have gone back to the host and said that, technical issues aside I am paying 5 times more for the VPS than I did for a basic shared hosting package, and everything suggests that the VPS underperforms when compared to the old shared host. Have a look at the attached image, which is from Google Analytics, everything to the left of the red line is from the shared host, everything to the right is the VPS. From this you can see that the cheap as chips shared host was handling more traffic without any issues.

There were two reasons for moving to VPS, primarily I intend to start promoting the site and therefore attract more traffic. On extremely busy days I would occasionally hit the hosts MySQL max concurrent connections limit (which was very low @ 15)

After a full on Google session I have found that everything I currently have on Cron is more or less exactly the same as 90% of other hosts out there. So I am at a loss.

I have a feeling that it might be time to introduce donations/subscriber system to the forum in order to pay for a decent hosting service. The community will love that
Attached Images
File Type: jpg therevcounter.com-ganalytics-summary-220208-050308.jpg (15.9 KB, 0 views)
Reply With Quote
  #7  
Old 03-07-2008, 10:08 AM
snakes1100 snakes1100 is offline
 
Join Date: Dec 2001
Location: Michigan
Posts: 3,733
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Have you checked the freemem at those times to see if your account is actually using that much ram that your supposedly allocated in the vps?

Have you checked the shm size for the kernel?
Reply With Quote
  #8  
Old 03-07-2008, 10:25 AM
MrEyes MrEyes is offline
 
Join Date: Nov 2004
Posts: 380
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by snakes1100 View Post
....checked the freemem....
No, because trying to catch this is similar to trying to catch a greased pig. The server will spit out errors at random times under random load on random days, and there is no way I can manually monitor the server 24/7 in the hope that this occurs.

If it was the "face value" memory issue considering that user/guest levels are fairly predictable (between 100 to 140 during normal daytime hours (GMT)) I would expect this to happen fairly regularly, however this just doesnt happen. For example right now there are "129 (100 members and 29 guests)" online and everything is holding up fine.

Quote:
Originally Posted by snakes1100 View Post
Have you checked the shm size for the kernel?
Not heard of that, how do I check this?
Reply With Quote
  #9  
Old 03-07-2008, 10:42 AM
snakes1100 snakes1100 is offline
 
Join Date: Dec 2001
Location: Michigan
Posts: 3,733
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Well each OS is different, but you can cat /proc/sys/kernel/shmmax, if that spits out an error saying it dont exist, ls /proc/sys/kernel and see what you have in there.

The default should spit back 33554432 = 32mb

You can try echo'ing in a larger value or change it in sysctl.conf

Im guessing that this may be a issue with the overall server of the vps and the ram not being allocated correctly to your vps, is the host US based or no?
Reply With Quote
  #10  
Old 03-07-2008, 11:17 AM
Dismounted's Avatar
Dismounted Dismounted is offline
 
Join Date: Jun 2005
Location: Melbourne, Australia
Posts: 15,047
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by MrEyes View Post
I have to admit that I do not fully understand the problem, however the VPS is capping out the max memory that it is able to use at an OS level, rather than PHP itself running out of allocated memory. So would changing the PHP memory cap actually do anything to resolve this.
Quote:
Fatal error: Out of memory (allocated 786432) (tried to allocate 1966080 bytes) in /home/primarysite/public_html/XXXX on line YYYY
The above error you posted is a PHP error, not an error at the OS level.
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:01 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04837 seconds
  • Memory Usage 2,294KB
  • Queries Executed 12 (?)
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_code
  • (9)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
  • (1)postbit_attachment
  • (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
  • postbit_attachment
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete