I have a web application that has been loading a lot in recent days. The application runs on the same server with an 8-core Intel processor and 4 GB of RAM . Software: Drupal 5 (Apache 2, PHP5, MySQL5) running on Debian .
After reaching 500 authenticated and 200 anonymous users (at the same time), the application drastically reduces its performance until a complete failure. The biggest load comes from authenticated users who perform actions causing insert / update / delete on db. I think mysql is the bottleneck. Is it normal to slow down so many users?
EDIT: I forgot to mention that I did some kind of profiling. I ran the commands top, htopand they showed me that all memory is used by MySQL! After a while, MySQL starts to work very slowly, the site goes down, and we need to restart / stop apache to reduce the load. Administrators said that at that time there were about 200 active mysql connections.
top, htop
The worst part is that we need to solve this problem, I can not perform deep profile analysis / code refactoring, so I consider two ways:
, . , . , .
. . , , . , . , SQL.
. , / , , , . , , ? / , db. , , ?
. - , ? , . , , , .
. , , -, . , ( ) . , , .
, :
, , , , , . , .
, , , . MySQL, , :--log-slow-queries--log--- -
"ps", , , , . vmstat ouput, , 60 .
, ps vmstat, , , , , , , , , 10 , . MySQL, , , , .
APC - -
Drupal -
Cacherouter cacherouter. / db (Memcache - )
Authcache cacherouter, 6. ( EasyAuthCache, )
upgrade to 6.x Basically, in version 6.x there are several convenient modules for unloading db by caching (in which case they would help a lot). I suspect your slow ones are being picked out of the views.
Source: https://habr.com/ru/post/1781174/More articles:Значение ScrollBar установлено неверно - c#How to create predicted output using Lazy - c #.c instead of .m projects in Objective-C? - objective-cif two dom elements are equal in java - javaHow to fix Unable to implicitly convert the type 'System.Web.Mvc.ViewResult' to 'string' - asp.netКак реализовать новый инструмент регистрации Facebook с помощью Rails? - rubySetting the default value of the selected list in the editor template - drop-down-menuJavascript fully generated user interface? - javascriptRandom Problem - javaBitmap in CUDA - cAll Articles