MySQL goes down with only PDO connections.

Asked 1 years ago, Updated 1 years ago, 101 views

To test the load on the rental server, we simulated it with 800 PV/sec access, but after a certain number of seconds (about 30 seconds) each time, the MySQL connection error occurs.
負荷 If the load test runs for about 15 seconds, there will be no problem.

The file you are accessing is PHP, and all you need to do is connect to MySQL using PDO.
SENo SELECT statement executed

What are the possible causes of connection errors?
The server is not down (load average is about 20%), and only MySQL goes down.
In this case, is there any possibility of improvement?
(Do I need to review my.cnf settings?)

In addition, only DB should be connected to the RDS of AWS as a trial. I tried the same process, but it went down in about 30 seconds.
The instance was db.m6g.4xlarge, so the specs are probably
I don't think there's anything I can say, but the maximum number of runs on the rental server side is limited
Should I consider myself working?

php mysql pdo

2022-09-30 19:33

1 Answers

Lack of assessment perspective.

  • Process execution status on DB side and DB side
  • Resource status on the DB access executor. (CPU memory)
  • Connection pool utilization on the DB access side
  • DB resource status, connection count information

It is a minimum I should like to see thatAs you said in the simulation, if you set up a web server in the first step and throw HTTP there, you won't know at all until you look at the number of sessions there.

I'm afraid I'm Esper, but I doubt it in the following order.

  • Connection pool exhaustion on the connecting side (not releasing the session)
  • Connection exhaustion at destination (normally upper limit as there are no infinite resources)
  • Resource exhaustion and session limits at the previous stage

As a general rule, the number of connections is large enough to be an important element of capacity planning, so you must limit them somewhere, so if you don't manage them properly (usually round to middle), they will overflow quickly.If you don't do this, the process will die quickly on both the receiver and the sender...By the way, the larger the system, the upper limit on the number of connections will be set at the middle of the inquiry side, and we will meet there.Since it's a simulator, isn't it directly connected at 800 seconds? If so, is that okay with the system design?

For example, PHP may be writing directly to the PDO without connecting from the middle DB connection pool, but I don't think that's the case, but I can imagine it just by looking at the text...


2022-09-30 19:33

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.