-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Severe performance issues #11761
Comments
Do you have sql connection pooling turned on?
|
@knoxcard2 yes |
Are you using mysql2 or mariadb? npm
yarn
|
@knoxcard2 Sorry for the delay. I had to upgrade to sequelize v5, and then switched to |
Did you set a db index on the name column?' |
I have not, however, the query that sequelize is producing, the MySQL server can process at around 100,000 req/s. Also this affects all sorts of queries, not a specific one. |
@MicroDroid - please post your code....another problem is the way you run the db query. It is better to wait for the previous query to finish on a callback and the run the next for INSERTS in some cases. |
@MicroDroid - Also, are you running update/insert codes one at a time? The bulkCreate() method allows bulk insert/update lightning fast. Below is a pseudocode for a fast bulk update based on the unique column 'url_slug'.
|
@knoxcard2 The queries I am making are SELECT ones. Anyhow, I make an SQL query based on an incoming HTTP request, thus bulk operations do not apply. That, and they're technically another thing, bulk operation benchmarks with or without sequelize will both be faster, but they do not apply to my usage. Here's my code: // ...
async get(ctx) {
const tag = await models.tag.findOne({
where: { name: ... },
});
if (!tag)
throw {status: 404, message: 'Not found'};
// return response immediately
}
// ... |
What I'm trying to convey is that the exact identical query, regardless of indices or any other optimization, are far, far slower when done through Like I said initially, the issue lies within Bluebird being slow and other code issues. |
@MicroDroid how do you benchmark? I am curious because i am also having performance issues with sequelize (but i use postgres) |
I benchmark with koa as web server + ApacheBench and compare performance when including a query or not |
We have removed bluebird, that should help #12140 |
@sushantdhiman do you need help with removing remains of Bluebird from code and docs? |
@jedwards1211 is working on tests (converting them to async) @kroleg you can help us with documentation cleanup :) |
Sorry, already done #12167 |
Issue Description
What are you doing?
Running a web server that does 1 SQL query and returns results:
What do you expect to happen?
3500+ req/s
What is actually happening?
460 req/s
Additional context
Promise
to add some extra functions that behave like Bluebird, and I was able to go up to ~830 req/s by ditching out Bluebird entirely.mysql2
, it can do up to 108,000 req/s - which is pretty much however fast is my running MariaDB server.With that in mind, I believe
sequelize
does introduce extremely awkward procedures that bring the speed down to 430 req/s - note that it should ideally do 50,000+ queries/s assuming the webserver in front of it is ditched away.Environment
Issue Template Checklist
How does this problem relate to dialects?
Would you be willing to resolve this issue by submitting a Pull Request?
The text was updated successfully, but these errors were encountered: