MySQL Forums
Forum List  »  PHP

Query grows slower as user activity increases
Posted by: Jayshree Yeolekar
Date: June 02, 2022 03:02AM

PHP Version: 7.3.19
mysql version: 10.4.13 (Maria DB)
I am running an application on Linux, using PHP and Mysql. We have multiple queries which runs perfectly fine when 20-25 people are using the application. But when the users are more than 30 users the query becomes very slow. there are more than 500 users which want to use this application. If one of the query takes 0.188844 seconds to execute, but when there are many users attempting to do the same activity at the same time, the processes becomes very slow and takes about 21.017460seconds to execute sometimes even more.

below is some of examples from slow query log:
===============# Time: 220601 7:42:44
# User@Host: root[root] @ WIN-MN0PM3TE06L [10.15.51.252]
# Thread_id: 41274 Schema: mahabhumi_prod8 QC_hit: No
# Query_time: 0.188844 Lock_time: 0.000154 Rows_sent: 0 Rows_examined: 51848
# Rows_affected: 0 Bytes_sent: 10337
SET timestamp=1654049564;
SELECT *
FROM (`kcc_requests`)
WHERE `aadhar_num` = 'XXXXX';

===============# Time: 220601 14:12:13
# User@Host: root[root] @ WIN-MUQCJ3KLLE2 [10.15.51.250]
# Thread_id: 81466 Schema: mahabhumi_prod8 QC_hit: No
# Query_time: 21.017460 Lock_time: 0.000071 Rows_sent: 0 Rows_examined: 52692
# Rows_affected: 0 Bytes_sent: 10337
SET timestamp=1654072933;
SELECT *
FROM (`kcc_requests`)
WHERE `aadhar_num` = 'YYYYY';
=================

Options: ReplyQuote


Subject
Written By
Posted
Query grows slower as user activity increases
June 02, 2022 03:02AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.