Are you going to improve performance?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Are you going to improve performance?

Fedor Belov
Hi. In Twitter someone mensioned intresting performance comparisson. It's really strange that Spring MVC and Grails has so big performance gap. We are building pretty popular web site and it's important for us that response time should be less than 300ms and system should be scalable. As you can see it doesn't scale very well. Are you going to do something to improve it in future?
Reply | Threaded
Open this post in threaded view
|

Re: Are you going to improve performance?

Lari Hotari -
Lies, damn lies, benchmarks! :)
You can only say that Grails was slower in that benchmark. I don't think that benchmark is something you should be worried about.

The default config of Grails doesn't perform that well in some benchmarks because of the OSIV interceptor that limits concurrent requests to the maximum number of database connections available in the connection pool ( http://jira.grails.org/browse/GRAILS-8238). Grails 2.3 will only reserve a db connection if the request uses the database ( http://jira.grails.org/browse/GRAILS-9959).
There are also other Hibernate related performance improvements in Grails 2.3 ( http://jira.grails.org/browse/GRAILS-10063  http://jira.grails.org/browse/GRAILS-10064 ) related to flush mode optimizations.
Groovy&Java also needs a lot of iterations before it gets fully JITed. I usually measure performance after warming up the app with 20000 iterations and a short break (10 s).

Grails 2.3 contains a lot of small performance improvements:
http://jira.grails.org/browse/GRAILS-10087
http://jira.grails.org/browse/GRAILS-9958
All small changes more than doubled the throughput performance in a "empty controller" performance test. I get about 22.5k/req/s with my laptop.
I haven't profiled and fixed problems in grails resources and cache plugins and those might still contain some performance bottlenecks (like http://jira.grails.org/browse/GPCACHE-27).

However, a framework will never take care of scaling the solution.

You should design your solution in a way that you leverage plain HTTP caching where it's applicable.
This is a nice introductory article: http://www.slideshare.net/rtomayko/https-bestkept-secret-caching
(It's examples are about RoR but the same applies to any web framework)

Do you have a performance problem? Have you tried to profile it?

You have reported http://jira.grails.org/browse/GRAILS-9943 . It's fixed in Grails 2.3 ( http://jira.grails.org/browse/GRAILS-9906) and there is a workaround for older Grails versions.
Have you tried the workaround?

. Are you going to do something to improve it in future?
Grails is an opensource project. Your contributions are welcome. :)
Feedback and bug reports with test apps & reproducible examples of the problem are also a contribution that we appreciate. A bug report with a proper test app & reproducible example is much easier to fix.
 

Lari


13.08.2013 00:30, Fedor Belov wrote:
Hi. In Twitter someone mensioned intresting performance  comparisson
<http://content.jsfcentral.com/c/journal/view_article_content?cmd=view&groupId=35702&articleId=73398&version=1.8#.UglQkpL0FQE> 
. It's really strange that Spring MVC and Grails has so big performance gap.
We are building pretty popular web site and it's important for us that
response time should be less than 300ms and system should be scalable. As
you can see  it doesn't scale very well
<http://content.jsfcentral.com/documents/35702/69490/Fig307.PNG/a3675d1e-4a17-4b47-8144-f1bed621a69e?t=1371263339000> 
. Are you going to do something to improve it in future?



--
View this message in context: http://grails.1312388.n4.nabble.com/Are-you-going-to-improve-performance-tp4647929.html
Sent from the Grails - dev mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



Reply | Threaded
Open this post in threaded view
|

Re: Are you going to improve performance?

Fedor Belov
Thanks for response. It's cool that you are working on it. Just this question is important for me
Workaround for GRAILS-9943 fixed our problems (+ popularity of our service decreased because of strange marketing)

>Grails is an opensource project. Your contributions are welcome. :)
>Feedback and bug reports with test apps & reproducible examples of the problem are also a contribution that we appreciate. A bug report with a proper test app & reproducible example is much easier to fix.

I'm trying to help where it's possible (check this for example - http://grails.1312388.n4.nabble.com/Grails-DirectoryWatcher-td4647394.html ). But I (and most of other developers) can't help in performance and internal Grails / plugins features - because we don't have enough understanding and knowledge

13.08.2013 11:58, Lari Hotari пишет:
Lies, damn lies, benchmarks! :)
You can only say that Grails was slower in that benchmark. I don't think that benchmark is something you should be worried about.

The default config of Grails doesn't perform that well in some benchmarks because of the OSIV interceptor that limits concurrent requests to the maximum number of database connections available in the connection pool ( http://jira.grails.org/browse/GRAILS-8238). Grails 2.3 will only reserve a db connection if the request uses the database ( http://jira.grails.org/browse/GRAILS-9959).
There are also other Hibernate related performance improvements in Grails 2.3 ( http://jira.grails.org/browse/GRAILS-10063  http://jira.grails.org/browse/GRAILS-10064 ) related to flush mode optimizations.
Groovy&Java also needs a lot of iterations before it gets fully JITed. I usually measure performance after warming up the app with 20000 iterations and a short break (10 s).

Grails 2.3 contains a lot of small performance improvements:
http://jira.grails.org/browse/GRAILS-10087
http://jira.grails.org/browse/GRAILS-9958
All small changes more than doubled the throughput performance in a "empty controller" performance test. I get about 22.5k/req/s with my laptop.
I haven't profiled and fixed problems in grails resources and cache plugins and those might still contain some performance bottlenecks (like http://jira.grails.org/browse/GPCACHE-27).

However, a framework will never take care of scaling the solution.

You should design your solution in a way that you leverage plain HTTP caching where it's applicable.
This is a nice introductory article: http://www.slideshare.net/rtomayko/https-bestkept-secret-caching
(It's examples are about RoR but the same applies to any web framework)

Do you have a performance problem? Have you tried to profile it?

You have reported http://jira.grails.org/browse/GRAILS-9943 . It's fixed in Grails 2.3 ( http://jira.grails.org/browse/GRAILS-9906) and there is a workaround for older Grails versions.
Have you tried the workaround?

. Are you going to do something to improve it in future?
Grails is an opensource project. Your contributions are welcome. :)
Feedback and bug reports with test apps & reproducible examples of the problem are also a contribution that we appreciate. A bug report with a proper test app & reproducible example is much easier to fix.
 

Lari


13.08.2013 00:30, Fedor Belov wrote:
Hi. In Twitter someone mensioned intresting performance  comparisson
<http://content.jsfcentral.com/c/journal/view_article_content?cmd=view&groupId=35702&articleId=73398&version=1.8#.UglQkpL0FQE> 
. It's really strange that Spring MVC and Grails has so big performance gap.
We are building pretty popular web site and it's important for us that
response time should be less than 300ms and system should be scalable. As
you can see  it doesn't scale very well
<http://content.jsfcentral.com/documents/35702/69490/Fig307.PNG/a3675d1e-4a17-4b47-8144-f1bed621a69e?t=1371263339000> 
. Are you going to do something to improve it in future?



--
View this message in context: http://grails.1312388.n4.nabble.com/Are-you-going-to-improve-performance-tp4647929.html
Sent from the Grails - dev mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email




Reply | Threaded
Open this post in threaded view
|

Re: Are you going to improve performance?

Lari Hotari -
13.08.2013 12:37, Fedor Belov wrote:
Thanks for response. It's cool that you are working on it. Just this question is important for me
Workaround for GRAILS-9943 fixed our problems (+ popularity of our service decreased because of strange marketing)

>Grails is an opensource project. Your contributions are welcome. :)
>Feedback and bug reports with test apps & reproducible examples of the problem are also a contribution that we appreciate. A bug report with a proper test app & reproducible example is much easier to fix.

I'm trying to help where it's possible (check this for example - http://grails.1312388.n4.nabble.com/Grails-DirectoryWatcher-td4647394.html ). But I (and most of other developers) can't help in performance and internal Grails / plugins features - because we don't have enough understanding and knowledge

Thanks for your help and feedback. The directory watcher is  a great contribution. It just might take a long time before it's integrated if there isn't a fallback for older JVMs (or is there a fallback?). Have you created a Jira for the feature request?

Personally, I wish that the change detection did grouping. For example if you have a Grails application project and switch to a another git branch, a lot of files get changed and updated at once. The hibernate plugin just skrews up when it gets a lot of changes to many files at the same time. Grouping change events is missing from Grails and that is a problem. Of course the problem isn't very crucial since you can always stop Grails before switching git branches..

If you have performance problems the best thing is to try to understand what the bottleneck is. I've used YourKit Java Profiler for profiling Grails and you can find some of my earlier advices about using it by searching the mailing list archives.

As I mentioned in the earlier email, I'd recommend designing your popular website app in a way where you can leverage plain-old HTTP caching as much as possible.

Lari