-
-
Notifications
You must be signed in to change notification settings - Fork 10
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
Very slow. Why by default in a new app? #7
Comments
It's the default, IIRC, because a) rails has ActiveRecord going by default and part of the inspiration for buffalo is rails and b) most web app need a db component and pop is the one that mark built specifically for buffalo. Please feel free to use |
You can't say something like that without providing some numbers. Very slow is subjective and means nothing. :) |
You're right. I don't have time now for pushing projects, but:
Same code and same db (pq) with var player models.Player
if err := models.DB.Last(&player); err != nil {
return &player, fmt.Errorf("no selected player")
}
return &player, nil |
@frederikhors ive the same issue, i dont recommend using pop transaction middleware. in many of my cases, connection did not close properly and causing db connection to go beyond my cloud server provided |
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment. Otherwise, this will be closed in 7 days. |
First, this issue is interesting. Performance is one of the important factors for developers even though not all developers are working on a performance-sensitive application (but still they are looking for that) and sometimes productivity with reliability "out of the box" could be better for (maybe) many developers. Anyway, the interesting part is the following:
In the Buffalo way, in other simple words the controller generated by After reading the original post and the additional reprod steps further, it seems like I found the reason. The controller uses
The concept of pop middleware is great. It provides database transactions transparently, so developers can just focus on the business logic then the transaction commit or rollback will be done by the middleware automatically. Also, the middleware provides timing information on the log, which is also useful. By the way, one of my recent questions regarding Pop in my mind was how can we have better visibility on connection pool usage/management so I feel like this issue is a good input for developing the question. Also, another question was how to prevent a transaction for a non-database-related request or how to reduce the duration of a transaction. I will keep this issue in mind once I started on the work. (I will close this issue once I open separate issues for those) |
Oh, it looks like #28 is clearly explaining the situation of the performance issue that happened when using |
Some test results with a simple stress test:
echo 'GET http://localhost:3000/bmt-endpoint' \
| vegeta attack -rate 5000 -duration 5s -max-workers 150 | tee results.bin \
| vegeta report Test with
Test with
Topics that need to be discussed:
It can be a global scope rather than buffalo pop. However, I will track this performance/design issue here for now. |
This is extremely slow and it is a pity this is a default in a new Gobuffalo app (until performances increase...).
Can I understand why this is the default?
If I comment default lines in
app.go
Buffalo is much faster!// app.Use(popmw.Transaction(models.DB))
Beego and others doesn't have transaction manager like this by default.
Is this also like Rails ActiveRecord behaviour?
I'm using just this code for some perf tests using in a new project just one resolver:
The text was updated successfully, but these errors were encountered: