How many users are enough to make a big load for a web application

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.

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:

  • My tables are MyIsam, I heard they use table-level locking, which is very slow, right? can i change it to innodb without worrying?
  • What if I take MySQL and move it to a dedicated computer with lots of RAM?
+3
3

, . , . , .

  • . . , , . , . , SQL.

  • . , / , , , . , , ? / , db. , , ?

  • . - , ? , . , , , .

  • . , , -, . , ( ) . , , .

+2

, :

  • : , .
  • : , - .

, , , , , . , .

, , , . MySQL, , :
--log-slow-queries
--log--- -

"ps", , , , . vmstat ouput, , 60 .

, ps vmstat, , , , , , , , , 10 , . MySQL, , , , .

0

h2 >

  • APC - -

  • Drupal -

Option1

Option2

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

0
source

Source: https://habr.com/ru/post/1781174/


All Articles