Jump to content

Memory Management


abazoskib

Recommended Posts

when i run free -m i get:

            total       used       free     shared    buffers     cached
Mem:          1746       1286        460          0        162        853
-/+ buffers/cache:        270       1475
Swap:          895          0        895

 

I feel like the system has been lagging ever since I changed my apache configuration. Here are my settings:

 

Apache

StartServers       20
MinSpareServers    30
MaxSpareServers   80
ServerLimit      256
MaxClients       256
MaxRequestsPerChild  4000

 

PHP

max_execution_time = 90     ; Maximum execution time of each script, in seconds
max_input_time = 240    ; Maximum amount of time each script may spend parsing request data
memory_limit = 128M      ; Maximum amount of memory a script may consume (16MB)

 

MYSQL

 

key_buffer_size,268435456
max_allowed_packet,33554432
max_binlog_cache_size,4294967295
max_binlog_size,1073741824
max_connect_errors,10
max_connections,4000
query_alloc_block_size,8192
query_cache_limit,1048576
query_cache_min_res_unit,4096
query_cache_size,0
query_cache_type,ON

 

How can I improve my configuration for performance? I am doing lots of db intensive work, mostly PHP scripting, running a SOAP server, and lots of PHP/curl data transmissions. Getting lots of traffic on the SOAP server per day.

Link to comment
Share on other sites

its a constant incoming data feed all day. this particular server gets data from two separate websites in terms of passing data from a form(~5000 records) and a batch of close to 100,000 records per day from ftp which get imported from a few CSV files every day.

 

The server also sends the same (~5000) records to another source through PHP/curl after each record has been cleaned and processed by the server. I might have been a little too generous with the Apache settings, but I am not an expert server admin. Just looking for different opinions in order to avoid my own paranoia and biases.

Link to comment
Share on other sites

havent used swap ever i believe. this is today's status:

 

             total       used       free     shared    buffers     cached
Mem:          1746       1321        425          0        162        866
-/+ buffers/cache:        292       1454
Swap:          895          0        895

Link to comment
Share on other sites

So you have 1.7GB of ram? I missed that before.

 

I'm using the following settings on a server with 4gb ram which gets 1-2 million hits a week, and 90+gb traffic a week:

StartServers        8

MinSpareServers    5

MaxSpareServers    20

MaxClients          256

MaxRequestsPerChild 1000

 

I suggest you install "munin" to monitor your server. It will tell you your cpu and memory usage, and if there are any iowait issues.

 

-steve

Link to comment
Share on other sites

  • 2 weeks later...
This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.