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

Already on GitHub? Sign in to your account

Massive Web UI performance issues on Raspberry Pi #736

Closed
jonashaag opened this Issue Jul 17, 2014 · 3 comments

Comments

Projects
None yet
3 participants

On Raspberry Pi, it takes up to 30 seconds to load a simple repository overview page.

I did a little bit of profiling on this but couldn't find one single source of slowness. It's hard to profile performance, though, because 90% of the logic is in templates, not Python code, which are difficult to properly profile.

May I suggest that on long term, logic should be moved from templates into the views and models, which has the following benefits:

  • It's the recommended programming style for Django
  • It's easier to profile and optimize
  • It's faster by multiple orders of magnitude

Rotzbua commented Jul 18, 2014

First: web ui is seahub, so you have to post the issue here: https://github.com/haiwen/seahub/issues
RasPi: (some experience I made)
-you need a sdcard with high random access performance
-overclocking would be good
-update firmware with rpi-update
-do not use ssl certs with more than 2048bit RSA-key (I tried with 16kbit RSA it took more than a minute to receive something..)
-do not use apache, use nginx or something else

Owner

lins05 commented Jul 18, 2014

Hi Jonas,

First thank you for your suggestion. But I disagree with your statements
"we put too much logic in the templates". Yes there are quite more lines of
code in templates files than in views and models files, but that's because
the nature of the template - it need to render into a html, it has
javascript, etc.

And here is a simple way to profile your seahub:

First add these lines to your seahub_settings.py

EXTRA_MIDDLEWARE_CLASSES = (
'seahub.base.profile.ProfilerMiddleware',
)

Then restart your seahub by "seahub.sh restart"

Then visit any page you want to profile with these url params appended:

?prof=true&sort=cumu

For expample:

https://myseafile.com/home/my/?__prof__=true&sort=cumu

The details can be found on
https://github.com/haiwen/seahub/blob/master/seahub/base/profile.py

On Fri, Jul 18, 2014 at 5:26 AM, Jonas Haag notifications@github.com
wrote:

On Raspberry Pi, it takes up to 30 seconds to load a simple repository
overview page.

I did a little bit of profiling on this but couldn't find one single
source of slowness. It's hard to profile performance, though, because 90%
of the logic is in templates, not Python code, which are difficult to
properly profile.

May I suggest that on long term, logic should be moved from templates into
the views and models, which has the following benefits:

  • It's the recommended programming style for Django
  • It's easier to profile and optimize
  • It's faster by multiple orders of magnitude


Reply to this email directly or view it on GitHub
#736.

Owner

lins05 commented Jul 18, 2014

Here is the typical screen shot of the profiler output.

1

@jonashaag jonashaag closed this Jul 18, 2014

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