Здравейте,
искам да попитам имали някакъв начин да се намали достъпа от дадено ip до системата, така че той да не претоварва сървъра. Имаме проблем с едно ip, което аксесва много сериозно сървъра и бих искал да намаля интензивноста на достъп до сървъра. Но не искам да го блокирам. Пробвах се да го направя с robots.txt, ама се оказа, че не е някакъв бот или паяк. Също така бихтели ми казали как мога най-добре да benchmark-на apache и да я настроя най-добре? На кои неща трябва да обърна внимание от статистиката, която получаваме от тестовете, така че в зависимост от тях да се съобразя и да настроя apache и mysql? Ето отва са текущите конфигурации за mysql и apache:
my.cnf
Примерен код |
[mysqld] datadir=/var/lib/mysql socket=/var/lib/mysql/mysql.sock # Default to using old password format for compatibility with mysql 3.x # clients (those using the mysqlclient10 compatibility package). old_passwords=0 bind-address=127.0.0.1 max_connections=300 # Set MyISAM parameters key_buffer_size=3M tmp_table_size=16M # Set InnoDB parameters innodb_file_per_table # Set buffer pool size to 50 - 80% of availiable memory. innodb_buffer_pool_size=1500M innodb_additional_mem_pool_size=50M # Set the log file size to about 25% of the buffer pool size. #innodb_log_file_size=5M #innodb_log_buffer_size=1M table_cache=1024 #sort_buffer_size=3M query_cache_type=1 query_cache_limit=1M query_cache_size=32M net_read_timeout=120 #long_query_time=10 #log_slow_queries=/var/log/mysql/slow-queries.log collation_server=utf8_unicode_ci character_set_server=utf8
[mysql] default-character-set=utf8
[mysqldump] default-character-set=utf8
[mysql.server] user=mysql basedir=/var/lib
[mysqld_safe] log-error=/var/log/mysqld.log pid-file=/var/run/mysqld/mysqld.pid
|
httpd.conf
Примерен код |
# Timeout: The number of seconds before receives and sends time out. # Timeout 120
# # 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 100
# # KeepAliveTimeout: Number of seconds to wait for the next request from the # same client on the same connection. # KeepAliveTimeout 3
## ## 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 # ServerLimit: maximum value for MaxClients for the lifetime of the server # MaxClients: maximum number of server processes allowed to start # MaxRequestsPerChild: maximum number of requests a server process serves <IfModule prefork.c> StartServers 4 MinSpareServers 10 MaxSpareServers 35 ServerLimit 128 MaxClients 128 MaxRequestsPerChild 2200 </IfModule>
|
Модулите, които не са ми необходими съм ги спрял да се зареждат в апаче.
ОС: CentOS 5
Kernel: 2.6.18-53.1.14.el5 x86_64 x86_64