Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Too many Process #3250

Open
AftabUfaq opened this issue Dec 2, 2024 · 3 comments
Open

Too many Process #3250

AftabUfaq opened this issue Dec 2, 2024 · 3 comments

Comments

@AftabUfaq
Copy link

in the phpmyadmin i have too many process with sleep query. what i have done i have reduces the wait_timeout and interactive_timeout to 10. but this has a huge impact on aborted clients.
Screenshot from 2024-12-02 15-11-22
Screenshot from 2024-12-02 15-10-35

@zoobibackups
Copy link

here is my pool setting .

my pool setting .


const { database,host, user, password } = config.database;
const pool = mysql.createPool({
  host: host,
  user: user,
  database: database,
  password:password,
  waitForConnections: true,
  connectionLimit: 100,
  connectTimeout:5000,
  queueLimit:20,
  maxIdle: 10,
  idleTimeout: 1000,
  enableKeepAlive: true,
  keepAliveInitialDelay: 0,
});

module.exports = pool;

here is my search function. i dont have nay complex query. don't have any ither issue. each query exection time is less .25 seconds. all tables are indexed properly.

async function searchResults(params) {
	let connection = null
	try {
		connection = await pool.getConnection()
		let db2Response = null;
		const [results, metadata] = await connection.query(
			`SELECT id , pName from contactsdb where nationalNumber = '${params.umr}' and countryId = 167 LIMIT 1`
		);
		if (results.length > 0) {
			db2Response = {
				status: true,
				results: results

			};
		} else {
			db2Response = {
				status: false,
				results: []

			};
		}
	} catch (error) {
		db2Response = {
			status: false,
			results: []

		};
	} finally {
		if (connection) {
			connection.release()
		}
	}
	return db2Response
}```

@zoobibackups
Copy link

this is related #2362 (comment)

@zoobibackups
Copy link

this is also related #2362 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants