Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
PostPosted: Sun Dec 16, 2012 12:18 pm 
Offline
Senior Newbie

Joined: Tue May 08, 2012 12:16 am
Posts: 13
I keep getting OOM errors even tho I am running a Linode 1G. Drupal 7 with about 300-500 unique page views a day and going up. Any and all help appreciated. site serviidb.com. PM me and I will give you address of php info.

Here the info

Code:
xxxx@serviidb:~# ab -n 200 -c 4 http://www.serviidb.com/
This is ApacheBench, Version 2.3 <$Revision: 655654 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking www.serviidb.com (be patient)
Completed 100 requests
Completed 200 requests
Finished 200 requests


Server Software:        Apache/2.2.14
Server Hostname:        www.serviidb.com
Server Port:            80

Document Path:          /
Document Length:        202809 bytes

Concurrency Level:      4
Time taken for tests:   1.141 seconds
Complete requests:      200
Failed requests:        0
Write errors:           0
Total transferred:      40668990 bytes
HTML transferred:       40561800 bytes
Requests per second:    175.23 [#/sec] (mean)
Time per request:       22.827 [ms] (mean)
Time per request:       5.707 [ms] (mean, across all concurrent requests)
Transfer rate:          34797.25 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        0    0   0.0      0       0
Processing:     1   23 144.7      2    1034
Waiting:        0   21 144.7      0    1031
Total:          1   23 144.7      2    1034

Percentage of the requests served within a certain time (ms)
  50%      2
  66%      2
  75%      3
  80%      3
  90%      3
  95%      4
  98%   1033
  99%   1033
 100%   1034 (longest request)


part of my apache2.conf

Code:
#


#
# Timeout: The number of seconds before receives and sends time out.
#
Timeout 300

#
# KeepAlive: Whether or not to allow persistent connections (more than
# one request per connection). Set to "Off" to deactivate.
#
KeepAlive On

#
# MaxKeepAliveRequests: The maximum number of requests to allow
# during a persistent connection. Set to 0 to allow an unlimited amount.
# We recommend you leave this number high, for maximum performance.
#
MaxKeepAliveRequests 2

#
# KeepAliveTimeout: Number of seconds to wait for the next request from the
# same client on the same connection.
#
KeepAliveTimeout 6

##
## Server-Pool Size Regulation (MPM specific)
##

# prefork MPM
# StartServers: number of server processes to start
# MinSpareServers: minimum number of server processes which are kept spare
# MaxSpareServers: maximum number of server processes which are kept spare
# MaxClients: maximum number of server processes allowed to start
# MaxRequestsPerChild: maximum number of requests a server process serves
<IfModule mpm_prefork_module>
    StartServers          1
    MinSpareServers       3
    MaxSpareServers      6
   ServerLimit          24
    MaxClients          24
    MaxRequestsPerChild 3000
</IfModule>


# Include generic snippets of statements
Include /etc/apache2/conf.d/

# Include the virtual host configurations:
Include /etc/apache2/sites-enabled/


Include /etc/phpmyadmin/apache.conf


parts of MYSQL my.com

Code:
[mysqld]

max_allowed_packet = 16M
key_buffer = 16k
sort_buffer_size = 2M
read_buffer_size = 2M
read_rnd_buffer_size = 2M
myisam_sort_buffer_size = 2M
query_cache_size = 14M

#
# * Basic Settings
#

#
# * IMPORTANT
#   If you make changes to these settings and your system uses apparmor, you may
#   also need to also adjust /etc/apparmor.d/usr.sbin.mysqld.
#

user      = mysql
socket      = /var/run/mysqld/mysqld.sock
port      = 3306
basedir      = /usr
datadir      = /var/lib/mysql
tmpdir      = /tmp
skip-external-locking
#
# Instead of skip-networking the default is now to listen only on
# localhost which is more compatible and is not less secure.
bind-address      = 127.0.0.1
#
# * Fine Tuning
#
#key_buffer      = 16M
max_allowed_packet   = 1M
thread_stack      = 64K
thread_cache_size       = 4
# This replaces the startup script and checks MyISAM tables if needed
# the first time they are touched
myisam-recover         = BACKUP
#max_connections        = 100
#table_cache            = 64
#thread_concurrency     = 10
#
# * Query Cache Configuration
#
query_cache_limit   = 1M
#query_cache_size        = 16M
#


Top
   
PostPosted: Sun Dec 16, 2012 12:50 pm 
Offline
Senior Newbie

Joined: Tue May 08, 2012 12:16 am
Posts: 13
I had forgot to restart after changing keepaliverequests to 2

Code:
xxxxx@serviidb:~# ab -n 500 -c 4 http://www.serviidb.com/
This is ApacheBench, Version 2.3 <$Revision: 655654 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking www.serviidb.com (be patient)
Completed 100 requests
Completed 200 requests
Completed 300 requests
Completed 400 requests
Completed 500 requests
Finished 500 requests


Server Software:        Apache/2.2.14
Server Hostname:        www.serviidb.com
Server Port:            80

Document Path:          /
Document Length:        202809 bytes

Concurrency Level:      4
Time taken for tests:   0.315 seconds
Complete requests:      500
Failed requests:        0
Write errors:           0
Total transferred:      101674000 bytes
HTML transferred:       101404500 bytes
Requests per second:    1587.34 [#/sec] (mean)
Time per request:       2.520 [ms] (mean)
Time per request:       0.630 [ms] (mean, across all concurrent requests)
Transfer rate:          315217.58 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        0    0   0.1      0       1
Processing:     1    2   0.9      2       8
Waiting:        0    1   0.6      0       4
Total:          1    2   0.9      2       8
WARNING: The median and mean for the waiting time are not within a normal deviation
        These results are probably not that reliable.

Percentage of the requests served within a certain time (ms)
  50%      2
  66%      3
  75%      3
  80%      3
  90%      3
  95%      4
  98%      5
  99%      6
 100%      8 (longest request)


Top
   
PostPosted: Mon Dec 17, 2012 1:17 pm 
Offline
Senior Member
User avatar

Joined: Tue May 26, 2009 3:29 pm
Posts: 1691
Location: Montreal, QC
You didn't share any info on actual memory usage, but you've got Apache configured to use up to 24 processes. If we assume the memory usage per Apache process is 80MB (which I think would be a high estimate), 24 * 80 = 1,920, which is well beyond how much memory you have.

Your maxclients should be something like 10, which leaves some room for MySQL, other things, caching, etc.

EDIT: You're also not using ab right for load testing if you're setting the concurrency way lower than your maxclients.


Top
   
PostPosted: Tue Dec 18, 2012 10:40 am 
Offline
Senior Newbie

Joined: Tue Dec 18, 2012 10:29 am
Posts: 5
Hi,

i was having the same problem in my drupal 7 site too. I have a linode 512mb.
Follow some support instructions, like the default configurations..
Disabled KeepAlive and MaxClients = 7 and stopped having problems and the site is must faster.. Although i would like to tune it more.
I'm not a sysadmin.. should i decrease MaxClients even more? One of the site's features is to upload large image files (4/5 mb) and using imagemagik to resize them, which consumes a lot of memory..
Should i install apc or memcached?

Can someone give me some advices to keep overall memory balanced?


Top
   
PostPosted: Tue Dec 18, 2012 2:26 pm 
Offline
Senior Member
User avatar

Joined: Tue May 26, 2009 3:29 pm
Posts: 1691
Location: Montreal, QC
One important thing to note is that while a user is uploading a large file, they're monopolizing one of those Apache processes. So if 7 people are uploading files at the same time, nobody will be able to access your site.

Your case of file uploads is different from the standard case, you need to keep your maxclients high enough for this scenario. You may need to do one of these two things:

1) Get more RAM to support higher maxclients
2) Switch from prefork to worker so that you can handle larger numbers of simultaneous clients in a more memory-friendly manner


Top
   
PostPosted: Tue Dec 18, 2012 7:02 pm 
Offline
Senior Newbie

Joined: Tue Dec 18, 2012 10:29 am
Posts: 5
Hi,

The uploads are only made by me and another person (content manager) the main purpose of the site is simply to display content... It's not for public user registrations at the moment.
Thank you for the advice, i'll have to upgrade the account in the future if i need those requirements.


Top
   
PostPosted: Tue Dec 18, 2012 7:06 pm 
Offline
Senior Member
User avatar

Joined: Tue May 26, 2009 3:29 pm
Posts: 1691
Location: Montreal, QC
You'll probably be fine then. You can test your site with ab (apache benchmark) with varying levels of concurrency to see how it handles the load with different maxclients setting. It may also be a decent way to see how much RAM things need.


Top
   
PostPosted: Thu Jan 03, 2013 11:32 am 
Offline
Senior Newbie

Joined: Tue May 08, 2012 12:16 am
Posts: 13
I changed from MBM-Prefork to MBM-worker mod-fcgid and my memory usage went from the high 700's to a pretty steady 400 meg. Site seems to be more responsive also.


Top
   
PostPosted: Sun Jan 13, 2013 3:09 am 
Offline
Newbie

Joined: Sun Jan 13, 2013 3:07 am
Posts: 2
I don't always browse the Linode forums, but when I do I spam.


Top
   
PostPosted: Sun Jan 13, 2013 3:21 pm 
Offline
Senior Member
User avatar

Joined: Sun Dec 27, 2009 11:12 pm
Posts: 1038
Location: Colorado, USA
More SPAM in the LINODE Forum.

Wonder what people think of LINODE after seeing all their stinky spam?

Really cool and techie - or just plain lazy and stupid?

Maybe we should have a POLL (which is almost as bad as spam).

Perhaps LINODE should read up on FORUM MODERATORS in the PHPBB Forum manual.

If only they had members across the globe, hence across all time zones, that could moderate such dribble.

Nah, that would make way too much sense.

_________________
Either provide enough details for people to help, or sit back and listen to the crickets chirp.
Security thru obscurity is a myth - and really really annoying.


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group