PDA

View Full Version : Memory maxing out on forum


DreadsUK
06-12-2014, 09:16 AM
OK, so our server had to be rebooted the other morning because we'd maxed out the memory. This is the first time this has happened so im looking at whats best to be done.

The server hosts have suggested we upgrade to a bigger memory package.I am wondering if there are practical things i can do this end first.

Is there a way we can work out where most of the memory is going? Are there things that can be deleted that won't then return 404 errors?

Thanks

Disco_Dave
06-12-2014, 09:42 AM
What host are you with?

ozzy47
06-12-2014, 09:57 AM
Server and site specs would help also.

DreadsUK
06-12-2014, 10:07 AM
What host are you with?

Currently with Nimbus Hosting ('http://www.nimbushosting.co.uk/') on the package: -

Whirlwind
1GB Memory
20GB Disk Space
100GB Bandwidth Transfer
Plesk 10 Domain License

final kaoss
06-12-2014, 03:35 PM
Here you go dreads, I can recommend flipperhost to you. I've been using them for a couple of years and very satisfied.

FlipperHost – $6.99/month 2GB OpenVZ VPS

4 CPU Cores
2GB RAM
2GB vSwap
100GB Disk space
3TB Bandwidth
100Mbps uplink
1x IPv4 address
OpenVZ/SolusVM
$6.99/Month | Order (https://www.flipperhost.com/billing/cart.php?a=confproduct&i=0)

Or another great vps deal (which I've never used yet):

VPSDime High Memory
6GB RAM
30GB disk space
4 vCPU cores
2TB bandwidth
1Gbps uplink
1x IPv4 address
IPv6 in Dallas/LA
OpenVZ/Custom Panel
Dallas, New Jersey
Los Angeles
$7/month
Order here (https://vpsdime.com/cart.php?a=confproduct&i=0)

Also there is a way to tell what's using up memory on linux but I forget the method atm. I'll post back if I find it.

Run the top command and you'll get results like this.

top - 11:23:34 up 2 days, 19:20, 2 users, load average: 0.00, 0.00, 0.00
Tasks: 202 total, 1 running, 201 sleeping, 0 stopped, 0 zombie
Cpu(s): 0.0%us, 0.0%sy, 0.0%ni,100.0%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st
Mem: 32940056k total, 19210460k used, 13729596k free, 182428k buffers
Swap: 2031608k total, 0k used, 2031608k free, 18688628k cached

PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
32326 csxbot 15 0 12760 1168 812 R 0.3 0.0 0:00.02 top
1 root 15 0 10368 700 584 S 0.0 0.0 0:02.17 init
2 root RT -5 0 0 0 S 0.0 0.0 0:00.00 migration/0
3 root 34 19 0 0 0 S 0.0 0.0 0:00.00 ksoftirqd/0
4 root RT -5 0 0 0 S 0.0 0.0 0:00.00 watchdog/0
5 root RT -5 0 0 0 S 0.0 0.0 0:00.00 migration/1
6 root 34 19 0 0 0 S 0.0 0.0 0:00.00 ksoftirqd/1
7 root RT -5 0 0 0 S 0.0 0.0 0:00.00 watchdog/1

tpearl5
06-12-2014, 04:13 PM
Do you have any caching mechanism installed, like xcache? If not, do that and install vboptimize before you switch hosts.

And, yeah, see what is taking up memory like final kaoss mentioned. It's either mysql or apache.

DreadsUK
06-13-2014, 08:44 AM
Here you go dreads, I can recommend flipperhost to you. I've been using them for a couple of years and very satisfied.

FlipperHost ? $6.99/month 2GB OpenVZ VPS

4 CPU Cores
2GB RAM
2GB vSwap
100GB Disk space
3TB Bandwidth
100Mbps uplink
1x IPv4 address
OpenVZ/SolusVM
$6.99/Month | Order (https://www.flipperhost.com/billing/cart.php?a=confproduct&i=0)

Or another great vps deal (which I've never used yet):

VPSDime High Memory
6GB RAM
30GB disk space
4 vCPU cores
2TB bandwidth
1Gbps uplink
1x IPv4 address
IPv6 in Dallas/LA
OpenVZ/Custom Panel
Dallas, New Jersey
Los Angeles
$7/month
Order here (https://vpsdime.com/cart.php?a=confproduct&i=0)

Thanks mate, thats really helpful. Gonna take a look at those. clearly better specs. My only concern is we are uk based and we'd be hosted in the states. Would this be an issue?


Also there is a way to tell what's using up memory on linux but I forget the method atm. I'll post back if I find it.

Run the top command and you'll get results like this.

top - 11:23:34 up 2 days, 19:20, 2 users, load average: 0.00, 0.00, 0.00
Tasks: 202 total, 1 running, 201 sleeping, 0 stopped, 0 zombie
Cpu(s): 0.0%us, 0.0%sy, 0.0%ni,100.0%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st
Mem: 32940056k total, 19210460k used, 13729596k free, 182428k buffers
Swap: 2031608k total, 0k used, 2031608k free, 18688628k cached

PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
32326 csxbot 15 0 12760 1168 812 R 0.3 0.0 0:00.02 top
1 root 15 0 10368 700 584 S 0.0 0.0 0:02.17 init
2 root RT -5 0 0 0 S 0.0 0.0 0:00.00 migration/0
3 root 34 19 0 0 0 S 0.0 0.0 0:00.00 ksoftirqd/0
4 root RT -5 0 0 0 S 0.0 0.0 0:00.00 watchdog/0
5 root RT -5 0 0 0 S 0.0 0.0 0:00.00 migration/1
6 root 34 19 0 0 0 S 0.0 0.0 0:00.00 ksoftirqd/1
7 root RT -5 0 0 0 S 0.0 0.0 0:00.00 watchdog/1

Where do i go to run this? never done this before or know what it is. Noob here :p

Dave
06-13-2014, 02:01 PM
Thanks mate, thats really helpful. Gonna take a look at those. clearly better specs. My only concern is we are uk based and we'd be hosted in the states. Would this be an issue?



Where do i go to run this? never done this before or know what it is. Noob here :p

I believe the latency between UK and USA is somewhere between 50 and 100ms, so you can expect such delay added to your HTTP requests. Personally, I wouldn't buy a host based in USA when my customers are from UK.

final kaoss
06-13-2014, 05:18 PM
This should be able to help you with it.
http://linux.about.com/od/commands/l/blcmdl1_top.htm

Zachery
06-13-2014, 05:30 PM
Why do you think the server is maxing out its memory, and why does your host think that?

CaptainAwesome
06-14-2014, 02:09 AM
How much traffic do you get?

DreadsUK
06-14-2014, 09:09 AM
Why do you think the server is maxing out its memory, and why does your host think that?

The site went down briefly. i contacted the host and they said it maxed out and they had to reboot the server

--------------- Added 1402740650 at 1402740650 ---------------

How much traffic do you get?

This i am not sure but its usually between 250 and 300 people online all day. i dont know if more came on at the time it went down

--------------- Added 1402746636 at 1402746636 ---------------

Do you have any caching mechanism installed, like xcache? If not, do that and install vboptimize before you switch hosts.

And, yeah, see what is taking up memory like final kaoss mentioned. It's either mysql or apache.

Just installed vboptomize. now trying to set up xcache. struggling a bit but hopefully that will help once thats done

final kaoss
06-14-2014, 03:45 PM
The site went down briefly. i contacted the host and they said it maxed out and they had to reboot the server



Do you have root access on your server? If you do then you can reset it yourself.

Also you can use this to help lazy load your pages. Might wind up saving you a ton of resources if your site is image heavy.
lazy load, load your page faster & save bandwidth
(https://vborg.vbsupport.ru/showthread.php?t=259302)

DreadsUK
06-14-2014, 04:58 PM
Do you have root access on your server? If you do then you can reset it yourself.

Also you can use this to help lazy load your pages. Might wind up saving you a ton of resources if your site is image heavy.
lazy load, load your page faster & save bandwidth
(https://vborg.vbsupport.ru/showthread.php?t=259302)

Just trying to set up xcache but no one seems to know how. im struggling

RichieBoy67
06-14-2014, 10:38 PM
Just trying to set up xcache but no one seems to know how. im struggling

Look at your server logs and see when the resource usage is high. it is often a cause of a database back up or some other major cron task that causes these issues.

Also, there are a number of settings you can change to lower resource usage..

Turn off the thread check for subscriptions, who read a thread.. make sure you keep add no cache headers off, Turn off whos online, spider identification...make sure you have the whos online feature set to random and not alphabetical. Basically just go through all of your setttings and see where you can reduce. Similiar threads is also a big hit.

Make sure people have to wait maybe 30 seconds between searches or posts..

There are many things you can do. Go through your mods as well to see if you can save any recourse.

Lazy load may make your pages load faster but it is not going to lessen the server load much if anything at all.

1 gig of ram isn't much really these days but your site should run at least under normal usage. My server has 16 gigs and I still get slow downs occasionally when under heavy load like someone doing amass mail while a full server back up is running.

Hope this helps

tbworld
06-15-2014, 02:13 AM
Don't worry @DreadsUK, you are on the right track with your learning curve. Everything was great at 50 simultaneous users, then you grew to 250, now things start to look and feel differently. Most of us have been there. Okay, okay, there are a few of you out there that are gifted -- you can smile now, while I get the pie ready. :)