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
https://forums.phpfreaks.com/topic/167868-memory-management/
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
https://forums.phpfreaks.com/topic/167868-memory-management/#findComment-885632
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
https://forums.phpfreaks.com/topic/167868-memory-management/#findComment-885878
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
https://forums.phpfreaks.com/topic/167868-memory-management/#findComment-886644
Share on other sites

  • 2 weeks later...

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.