Besoin d'un coup de main pour configuration d'un dédié

Besoin d'un coup de main pour configuration d'un dédié - Infrastructures serveurs - Systèmes & Réseaux Pro

Marsh Posté le 10-08-2011 à 17:50:26    

Bonjour à tous et un grand merci à ceux qui prendront le temps de lire ce sujet !
 
Je suis éditeur web, j'ai une petite dizaine de sites sous Wordpress et 2 forums (phpBB et vBulletin). Je suis chez Amen, j'étais sur un privé VDS30 et j'ai dû passer sur un dédié (ici ECO 6000) car Amen avait suspendu mon pack (à 2 reprises) pour non respect des CGU (d'après eux je consommais trop de CPU).
 
J'ai ainsi migré mes sites vers le nouveau serveur dédié. Le serveur tourne sous Debian 5 avec Plesk que j'ai mis à jour en version 10. J'ai réalisé la migration sous les conseils d'Amen en utilisant Plesk et l'outil de migration 'automatique'. Le problème, c'est que Plesk sur le privé était en version inférieure (potentiellement un souci de migration, ça reste à vérifier).
 
Les sites ont été migrés, les ndd redirigés. Seulement voilà, j'ai rapidement remarqué qu'un de mes forums générait trop de requêtes apache (des paquets d'apache2 dans top en ssh), les 6Go de RAM du serveur se remplissent, et au final l'ensemble des sites deviennent impossibles à charger). Quand je coupe le domaine avec le forum (le forum est sur un sous domaine, sur le domaine principal il y a aussi un site), l'ensemble charge mais assez lentement.
 
J'ai demandé des coups de mains à pas mal de monde, quelques problèmes m'ont proposé des configs mySql et Apache, mais au final le problème n'est pas réglé. J'ai par la suite décidé de supprimer temporairement le forum (tout en laissant l'autre site sur le même domaine disponible), le problème de requêtes s'est stoppé quelques heures mais a repris rapidement et maintenant je me retrouve avec des sites qui peuvent charger mais il faut attendre généralement entre 20 à 40 secondes en fonction du moment de la journée.
 
Donc là je suis plutôt coincé, mon outil de travail principal (mes sites) ne fonctionne pas correctement et ça va commencer à devenir difficile de gagner ma vie. Vous imaginez la situation, sachant que je n'ai pas un profil très technique.
 
Mes hypothèses :
 

  • problème de configuration apache : comme expliqué, j'ai eu quelques coups de main, mais au final rien ne change, peut être faut-il encore regarder ça
  • problème de configuration mysql : quand le serveur commence à ne plus répondre, j'ai souvent des erreurs mySQL, les sites n'arrivent pas à accéder aux bases, ce genre de chose
  • DDoS ou similaire : ça peut paraître absurde, mais en gardant en tête le fait qu'Amen ait suspendu mon ancien pack il y a déjà 2 semaines pour surconsommation, pourquoi pas ?  
  • problème de migration : les bases sont corrompues, les fichiers déconnent, je sais pas. Le truc c'est que les sites quand ils chargent bien fonctionnent parfaitement, c'est juste une question de vitesse de chargement


 
Solutions appliquées pour l'instant :
 

  • Repair / optimize de toutes les tables (via phpmyadmin et ssh)
  • Tentatives de configurations d'Apache et Mysql


 
J'ai intitulé mon sujet par rapport au souci de configuration, car j'ai vraiment l'impression que tous mes ennuis viennent de là (je l'espère en fait), mais à vrai dire je suis totalement dans le flou.
 
De quelles infos auriez-vous besoin afin de me filer un petit coup de main qui me permette enfin de reprendre le boulot normalement ? :)
 
Merci beaucoup pour votre temps !
 
- Axel
 
ps : pour information, quand j'ai des erreurs elles sont du type :
 
Pour vBulletin (par email) :
 

Code :
  1. Database error in vBulletin :
  2. mysqli_real_connect() [<a href='function.mysqli-real-connect'>function.mysqli-real-connect</a>]: (08004/1040): Too many connections
  3. /var/www/vhosts/xxxxx/subdomains/forums/httpdocs/includes/class_core.php on line 1305


 
 
Dans Plesk même :
 

Code :
  1. ERROR: PleskFatalException
  2. Unable to connect to database: mysql_connect() [<a href='function.mysql-connect'>function.mysql-connect</a>]: Too many connections


 
 
Pour les sites parfois :
 

Code :
  1. Error establishing a database connection


Message édité par baggynou le 10-08-2011 à 17:56:01
Reply

Marsh Posté le 10-08-2011 à 17:50:26   

Reply

Marsh Posté le 10-08-2011 à 18:12:28    

A priori c'est assez explicite regarde le nombe de connexions autorisees dans la config mysqm my.cnf et essaye de l'augmenter

Reply

Marsh Posté le 10-08-2011 à 18:59:17    

Bonjour et merci pour cette réponse, j'en profite pour c/c mes configs my.cnf et apache. Dites-moi si vous voyez quelque chose qui vous choque (désolé pour la longueur des textes :/) :
 
my.cnf:
 

Code :
  1. GNU nano 2.0.7               File: my.cnf
  2. # bind-address          = 127.0.0.1
  3. #
  4. # * Fine Tuning
  5. #
  6. #key_buffer             = 16M
  7. key_buffer              = 32M
  8. #max_allowed_packet     = 16M
  9. max_allowed_packet      = 32M
  10. thread_stack            = 128K
  11. thread_cache_size       = 8
  12. # This replaces the startup script and checks MyISAM tables if needed
  13. # the first time they are touched
  14. myisam-recover          = BACKUP
  15. #max_connections        = 5000
  16. #table_cache            = 64
  17. #thread_concurrency     = 10
  18. #
  19. # * Query Cache Configuration
  20. #
  21. #query_cache_limit       = 1M
  22. #query_cache_size        = 16M
  23. query_cache_limit        = 4M
  24. query_cache_size         = 32M
  25. #
  26. # * Logging and Replication
  27. #
  28. # Both location gets rotated by the cronjob.
  29. # Be aware that this log type is a performance killer.
  30. #log            = /var/log/mysql/mysql.log
  31. #
  32. # Error logging goes to syslog. This is a Debian improvement :)
  33. #
  34. # Here you can see queries with especially long duration
  35. #log_slow_queries       = /var/log/mysql/mysql-slow.log
  36. #long_query_time = 2
  37. #log-queries-not-using-indexes
  38. #
  39. # The following can be used as easy to replay backup logs or for replication.
  40. # note: if you are setting up a replication slave, see README.Debian about
  41. #       other settings you may need to change.
  42. #server-id              = 1
  43. #log_bin                        = /var/log/mysql/mysql-bin.log
  44. expire_logs_days        = 10
  45. max_binlog_size         = 100M
  46. #binlog_do_db           = include_database_name
  47. #binlog_ignore_db       = include_database_name
  48. #
  49. # * BerkeleyDB
  50. #
  51. # Using BerkeleyDB is now discouraged as its support will cease in 5.1.12.
  52. skip-bdb
  53. #
  54. # * InnoDB
  55. #
  56. # InnoDB is enabled by default with a 10MB datafile in /var/lib/mysql/.
  57. # Read the manual for more InnoDB related options. There are many!
  58. # You might want to disable InnoDB to shrink the mysqld process by circa 100MB.
  59. #skip-innodb
  60. #
  61. # * Security Features
  62. #
  63. # Read the manual, too, if you want chroot!
  64. # chroot = /var/lib/mysql/
  65. #
  66. # For generating SSL certificates I recommend the OpenSSL GUI "tinyca".
  67. #
  68. # ssl-ca=/etc/mysql/cacert.pem
  69. # ssl-cert=/etc/mysql/server-cert.pem
  70. # ssl-key=/etc/mysql/server-key.pem
  71. [mysqldump]
  72. quick
  73. quote-names
  74. max_allowed_packet      = 16M
  75. [mysql]
  76. #no-auto-rehash # faster start of mysql but no tab completition
  77. [isamchk]
  78. key_buffer              = 16M
  79. #
  80. # * NDB Cluster
  81. #
  82. # See /usr/share/doc/mysql-server-*/README.Debian for more information.
  83. #
  84. # The following configuration is read by the NDB Data Nodes (ndbd processes)
  85. # not from the NDB Management Nodes (ndb_mgmd processes).
  86. #
  87. # [MYSQL_CLUSTER]
  88. # ndb-connectstring=127.0.0.1
  89. #
  90. # * IMPORTANT: Additional settings that can override those from this file!
  91. #   The files must end with '.cnf', otherwise they'll be ignored.
  92. #
  93. !includedir /etc/mysql/conf.d/


 
 
apache2.conf :
 

Code :
  1. # Based upon the NCSA server configuration files originally by Rob McCool.
  2. #
  3. # This is the main Apache server configuration file.  It contains the
  4. # configuration directives that give the server its instructions.
  5. # See http://httpd.apache.org/docs/2.2/ for detailed information about
  6. # the directives.
  7. #
  8. # Do NOT simply read the instructions in here without understanding
  9. # what they do.  They're here only as hints or reminders.  If you are unsure
  10. # consult the online docs. You have been warned.
  11. #
  12. # The configuration directives are grouped into three basic sections:
  13. #  1. Directives that control the operation of the Apache server process as a
  14. #     whole (the 'global environment').
  15. #  2. Directives that define the parameters of the 'main' or 'default' server,
  16. #     which responds to requests that aren't handled by a virtual host.
  17. #     These directives also provide default values for the settings
  18. #     of all virtual hosts.
  19. #  3. Settings for virtual hosts, which allow Web requests to be sent to
  20. #     different IP addresses or hostnames and have them handled by the
  21. #     same Apache server process.
  22. #
  23. # Configuration and logfile names: If the filenames you specify for many
  24. # of the server's control files begin with "/" (or "drive:/" for Win32), the
  25. # server will use that explicit path.  If the filenames do *not* begin
  26. # with "/", the value of ServerRoot is prepended -- so "/var/log/apache2/foo.log"
  27. # with ServerRoot set to "" will be interpreted by the
  28. # server as "//var/log/apache2/foo.log".
  29. #
  30. ### Section 1: Global Environment
  31. #
  32. # The directives in this section affect the overall operation of Apache,
  33. # such as the number of concurrent requests it can handle or where it
  34. # can find its configuration files.
  35. #
  36. #
  37. # ServerRoot: The top of the directory tree under which the server's
  38. # configuration, error, and log files are kept.
  39. #
  40. # NOTE!  If you intend to place this on an NFS (or otherwise network)
  41. # mounted filesystem then please read the LockFile documentation (available
  42. # at <URL:http://httpd.apache.org/docs-2.1/mod/mpm_common.html#lockfile> );
  43. # you will save yourself a lot of trouble.
  44. #
  45. # Do NOT add a slash at the end of the directory path.
  46. #
  47. ServerRoot "/etc/apache2"
  48. #
  49. # The accept serialization lock file MUST BE STORED ON A LOCAL DISK.
  50. #
  51. #<IfModule !mpm_winnt.c>
  52. #<IfModule !mpm_netware.c>
  53. LockFile /var/lock/apache2/accept.lock
  54. #</IfModule>
  55. #
  56. # PidFile: The file in which the server should record its process
  57. # identification number when it starts.
  58. # This needs to be set in /etc/apache2/envvars
  59. #
  60. PidFile ${APACHE_PID_FILE}
  61. #
  62. # Timeout: The number of seconds before receives and sends time out.
  63. #
  64. Timeout 30
  65. #
  66. # KeepAlive: Whether or not to allow persistent connections (more than
  67. # one request per connection). Set to "Off" to deactivate.
  68. #
  69. #KeepAlive On
  70. KeepAlive On
  71. #
  72. # MaxKeepAliveRequests: The maximum number of requests to allow
  73. # during a persistent connection. Set to 0 to allow an unlimited amount.
  74. # We recommend you leave this number high, for maximum performance.
  75. #
  76. MaxKeepAliveRequests 100
  77. #
  78. # KeepAliveTimeout: Number of seconds to wait for the next request from the
  79. # same client on the same connection.
  80. #
  81. KeepAliveTimeout 5
  82. ##
  83. ## Server-Pool Size Regulation (MPM specific)
  84. ##
  85. # prefork MPM
  86. # StartServers: number of server processes to start
  87. # MinSpareServers: minimum number of server processes which are kept spare
  88. # MaxSpareServers: maximum number of server processes which are kept spare
  89. # MaxClients: maximum number of server processes allowed to start
  90. # MaxRequestsPerChild: maximum number of requests a server process serves
  91. <IfModule mpm_prefork_module>
  92.     StartServers          5
  93.     MinSpareServers       5
  94.     MaxSpareServers      10
  95.     MaxClients          256
  96.     MaxRequestsPerChild   0
  97. </IfModule>
  98. <IfModule mpm_worker_module>
  99.     StartServers          2
  100.     MinSpareThreads      25
  101.     MaxSpareThreads      75
  102.     ThreadLimit          64
  103.     ThreadsPerChild      25
  104.     MaxClients          256
  105.     MaxRequestsPerChild   0
  106. </IfModule>
  107. # These need to be set in /etc/apache2/envvars
  108. User ${APACHE_RUN_USER}
  109. Group ${APACHE_RUN_GROUP}
  110. #
  111. # AccessFileName: The name of the file to look for in each directory
  112. # for additional configuration directives.  See also the AllowOverride
  113. # directive.
  114. #
  115. AccessFileName .htaccess
  116. #
  117. # The following lines prevent .htaccess and .htpasswd files from being
  118. # viewed by Web clients.
  119. #
  120. <Files ~ "^\.ht">
  121.     Order allow,deny
  122.     Deny from all
  123. </Files>
  124. #
  125. # DefaultType is the default MIME type the server will use for a document
  126. # if it cannot otherwise determine one, such as from filename extensions.
  127. # If your server contains mostly text or HTML documents, "text/plain" is
  128. # a good value.  If most of your content is binary, such as applications
  129. # or images, you may want to use "application/octet-stream" instead to
  130. # keep browsers from trying to display binary files as though they are
  131. # text.
  132. #
  133. DefaultType text/plain
  134. #
  135. # HostnameLookups: Log the names of clients or just their IP addresses
  136. # e.g., www.apache.org (on) or 204.62.129.132 (off).
  137. # The default is off because it'd be overall better for the net if people
  138. # had to knowingly turn this feature on, since enabling it means that
  139. # each client request will result in AT LEAST one lookup request to the
  140. # nameserver.
  141. #
  142. HostnameLookups Off
  143. # ErrorLog: The location of the error log file.
  144. # If you do not specify an ErrorLog directive within a <VirtualHost>
  145. # container, error messages relating to that virtual host will be
  146. # logged here.  If you *do* define an error logfile for a <VirtualHost>
  147. # container, that host's errors will be logged there and not here.
  148. #
  149. ErrorLog /var/log/apache2/error.log
  150. #
  151. # LogLevel: Control the number of messages logged to the error_log.
  152. # Possible values include: debug, info, notice, warn, error, crit,
  153. # alert, emerg.
  154. #
  155. LogLevel warn
  156. # Include module configuration:
  157. Include /etc/apache2/mods-enabled/*.load
  158. Include /etc/apache2/mods-enabled/*.conf
  159. # Include all the user configurations:
  160. Include /etc/apache2/httpd.conf
  161. # Include ports listing
  162. Include /etc/apache2/ports.conf
  163. #
  164. # The following directives define some format nicknames for use with
  165. # a CustomLog directive (see below).
  166. # If you are behind a reverse proxy, you might want to change %h into %{X-Forwarded-For}i
  167. #
  168. LogFormat "%v:%p %h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" vhost_combined
  169. LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
  170. LogFormat "%h %l %u %t \"%r\" %>s %b" common
  171. LogFormat "%{Referer}i -> %U" referer
  172. LogFormat "%{User-agent}i" agent
  173. #
  174. # Define an access log for VirtualHosts that don't define their own logfile
  175. CustomLog /var/log/apache2/other_vhosts_access.log vhost_combined
  176. #
  177. # Customizable error responses come in three flavors:
  178. # 1) plain text 2) local redirects 3) external redirects
  179. #
  180. # Some examples:
  181. #ErrorDocument 500 "The server made a boo boo."
  182. #ErrorDocument 404 /missing.html
  183. #ErrorDocument 404 "/cgi-bin/missing_handler.pl"
  184. #ErrorDocument 402 http://www.example.com/subscription_info.html
  185. #
  186. #
  187. # Putting this all together, we can internationalize error responses.
  188. #
  189. # We use Alias to redirect any /error/HTTP_<error>.html.var response to
  190. # our collection of by-error message multi-language collections.  We use
  191. # includes to substitute the appropriate text.
  192. #
  193. # You can modify the messages' appearance without changing any of the
  194. # default HTTP_<error>.html.var files by adding the line:
  195. #
  196. #   Alias /error/include/ "/your/include/path/"
  197. #
  198. # which allows you to create your own set of files by starting with the
  199. # /usr/share/apache2/error/include/ files and copying them to /your/include/path/,
  200. # even on a per-VirtualHost basis.  The default include files will display
  201. # your Apache version number and your ServerAdmin email address regardless
  202. # of the setting of ServerSignature.
  203. #
  204. # The internationalized error documents require mod_alias, mod_include
  205. # and mod_negotiation.  To activate them, uncomment the following 30 lines.
  206. #    Alias /error/ "/usr/share/apache2/error/"
  207. #
  208. #    <Directory "/usr/share/apache2/error">
  209. #        AllowOverride None
  210. #        Options IncludesNoExec
  211. #        AddOutputFilter Includes html
  212. #        AddHandler type-map var
  213. #        Order allow,deny
  214. #        Allow from all
  215. #        LanguagePriority en cs de es fr it nl sv pt-br ro
  216. #        ForceLanguagePriority Prefer Fallback
  217. #    </Directory>
  218. #    ErrorDocument 400 /error/HTTP_BAD_REQUEST.html.var
  219. #    ErrorDocument 401 /error/HTTP_UNAUTHORIZED.html.var
  220. #    ErrorDocument 403 /error/HTTP_FORBIDDEN.html.var
  221. #    ErrorDocument 404 /error/HTTP_NOT_FOUND.html.var
  222. #    ErrorDocument 405 /error/HTTP_METHOD_NOT_ALLOWED.html.var
  223. #    ErrorDocument 408 /error/HTTP_REQUEST_TIME_OUT.html.var
  224. #    ErrorDocument 410 /error/HTTP_GONE.html.var
  225. #    ErrorDocument 411 /error/HTTP_LENGTH_REQUIRED.html.var
  226. #    ErrorDocument 412 /error/HTTP_PRECONDITION_FAILED.html.var
  227. #    ErrorDocument 413 /error/HTTP_REQUEST_ENTITY_TOO_LARGE.html.var
  228. #    ErrorDocument 414 /error/HTTP_REQUEST_URI_TOO_LARGE.html.var
  229. #    ErrorDocument 415 /error/HTTP_UNSUPPORTED_MEDIA_TYPE.html.var
  230. #    ErrorDocument 500 /error/HTTP_INTERNAL_SERVER_ERROR.html.var
  231. #    ErrorDocument 501 /error/HTTP_NOT_IMPLEMENTED.html.var
  232. #    ErrorDocument 502 /error/HTTP_BAD_GATEWAY.html.var
  233. #    ErrorDocument 503 /error/HTTP_SERVICE_UNAVAILABLE.html.var
  234. #    ErrorDocument 506 /error/HTTP_VARIANT_ALSO_VARIES.html.var
  235. # Include of directories ignores editors' and dpkg's backup files,
  236. # see README.Debian for details.
  237. # Include generic snippets of statements
  238. Include /etc/apache2/conf.d/
  239. # Include the virtual host configurations:
  240. Include /etc/apache2/sites-enabled/
  241. AddOutputFilter INCLUDES .shtml
  242. AddType text/html .shtml
  243. AddType application/x-httpd-php .php
  244. AddType application/x-httpd-php-source .phps


 

Reply

Marsh Posté le 11-08-2011 à 21:25:06    

Le max_connections du my.cnf est commenté je connais pas la valeur par défaut essaye de ce côté

Reply

Sujets relatifs:

Leave a Replay

Make sure you enter the(*)required information where indicate.HTML code is not allowed