Owncloud is soooo slow!


23 posts
by JF002 » Fri Jul 27, 2012 3:11 pm
Hi everybody!

I installed Nginx 1.2.1, php5-fpm and Owncloud 4.0.4.

I works but... terribly slowly! It takes about 30sec to display a page.
During the rendering of a page, on server-side, I noticed that the process "php-fpm : pool www" uses all the CPU cycles.

I saw some posts on the forum and on the web saying that Owncloud runs quite smoothly on the rPi (using Apache), so, I suppose that it is a configuration issue. I thought that Nginx would be lighter that Apache...

I've not done any web development for some years, and I don't know how can I debug a web/php application in order to find the bottleneck.

Using the developper tool of Chrome, it seems that it is waiting most of the time for the CSS files, I don't have any other clues.

Any help?
My blog [FR] : http://blog.slashome.fr.cr
Posts: 80
Joined: Sat Feb 04, 2012 8:49 am
by Bioshox » Fri Jul 27, 2012 3:20 pm
nginx is alot lighter than Apache, but again the speed of it relies on your configurigation, your network speed, contention ration and the other services you have running on the Pi too.
Owner of: http://www.fusionstrike.com - I make gorgeous Raspberry Pi Tutorials :)
Posts: 100
Joined: Sun May 27, 2012 12:18 pm
Location: Manchester, United Kingdom.
by JF002 » Fri Jul 27, 2012 3:24 pm
I'm running nothing else on the Pi and it is connected by a RJ45 wire (100Mbps) to the local network. And I try to access to Owncloud locally, for now. So, I think the only problem is the configuration.
But I don't know where to look for, there are so many parameters in Nginx and PHP/PHP-FPM...
My blog [FR] : http://blog.slashome.fr.cr
Posts: 80
Joined: Sat Feb 04, 2012 8:49 am
by benthepoet » Fri Jul 27, 2012 4:53 pm
You could try installing APC for PHP. APC is an opcode accelerator that caches frequently used bits of PHP so it doesn't have to constantly recompile scripts (because PHP is an interpreted language). Install it with the following command and see if that helps.

sudo apt-get install php-apc
Ben Hanna
Ducky Pond
http://www.ducky-pond.com
Posts: 29
Joined: Sun Oct 02, 2011 5:36 am
Location: Traverse City, MI USA
by JF002 » Fri Jul 27, 2012 7:18 pm
Yeah, I could try php-apc.

But in my mind, there is another issue... I don't thing that the other posts I saw about owncloud/apache mentioned any optimizer...
My blog [FR] : http://blog.slashome.fr.cr
Posts: 80
Joined: Sat Feb 04, 2012 8:49 am
by benthepoet » Fri Jul 27, 2012 7:41 pm
Yeah, but it could still reduce some of that processing. Also are using SQLite as your database?
Ben Hanna
Ducky Pond
http://www.ducky-pond.com
Posts: 29
Joined: Sun Oct 02, 2011 5:36 am
Location: Traverse City, MI USA
by JF002 » Fri Jul 27, 2012 7:43 pm
Yes, I forgot to mention that I'm using sqlite... Should be lighter than Mysql, but it doesn't seems to be enough :?
My blog [FR] : http://blog.slashome.fr.cr
Posts: 80
Joined: Sat Feb 04, 2012 8:49 am
by JF002 » Fri Jul 27, 2012 7:51 pm
Another thing : I'm using an external USB hard drive as root file system.
My blog [FR] : http://blog.slashome.fr.cr
Posts: 80
Joined: Sat Feb 04, 2012 8:49 am
by ProudlyPiOwner » Sat Jul 28, 2012 8:29 am
Hi JF002, seems that I'm to stupid to send PMs, so here's your answer. I'm running a "normal" Apache 2.2 with no optimisers for PHP, the configs are untouched. In the Install Guide it says you should enable the Apache Mod's rewrite and headers and enable .htaccess files.
Did you check the equivalents for nginx? If you're using Squeeze try the new Raspbian!
Posts: 3
Joined: Tue Jul 24, 2012 3:38 pm
by JF002 » Sat Jul 28, 2012 9:03 am
I've just installed PHP-APC and the difference is huge!!!

Now pages load in ~4s!

So, perhaps you were right, benthepoet! I don't understand how it's possible that the processing of PHP code takes more than 30sec on a 700MHZ CPU, but I'm no PHP expert...

I think it could be interesting to debug this issue deeper in order to find the bottleneck and a better solution.
My blog [FR] : http://blog.slashome.fr.cr
Posts: 80
Joined: Sat Feb 04, 2012 8:49 am
by JF002 » Sat Jul 28, 2012 9:25 am
ProudlyPiOwner wrote:Hi JF002, seems that I'm to stupid to send PMs, so here's your answer. I'm running a "normal" Apache 2.2 with no optimisers for PHP, the configs are untouched. In the Install Guide it says you should enable the Apache Mod's rewrite and headers and enable .htaccess files.
Did you check the equivalents for nginx? If you're using Squeeze try the new Raspbian!


To be honest, I did not try to find equivalents to Apache Mod's rewrite, htaccess,... as owncloud is working. I thought that if a functionality was missing, it would not work at all. But you're write, I'll try to find some information about that!

Thanks for your answer!
My blog [FR] : http://blog.slashome.fr.cr
Posts: 80
Joined: Sat Feb 04, 2012 8:49 am
by JF002 » Sun Jul 29, 2012 9:16 am
I've just installed apache2 and Owncloud on it and it seems to run faster than using Nginx...
It's still slow (~10sec without apc, 3-5 sec with apc) but it seems smoother...

I didn't know that PHP was so heavy and needed so much processing power!
My blog [FR] : http://blog.slashome.fr.cr
Posts: 80
Joined: Sat Feb 04, 2012 8:49 am
by skyview » Sun Jul 29, 2012 1:36 pm
Last week I tried Debian w/ Apache2 & owncloud 4.0.4 .
It was incredibly slow on the PI. I did not find the cause of the slowness yet.

Disk ?
I tried external USB hdd's & USB sticks which improved read performance considerably.

CPU ?
I kept a look on the TOP cpu usage while running Owncloud. I can't confirm with a 100% certainty but CPU usage seemed OK.

Memory ?
I played a lot with the memory settings CPU / GPU. Made no difference regardless of the amount I assigned to the CPU.

It must be some kind of configuration issue. For now I skipped owncloud and went pure Debian w/ Apache2 & Webdav. Incredibly fast and responsive to browse folders and sync.
Posts: 1
Joined: Fri Jul 27, 2012 10:27 am
by TCB13 » Sun Nov 04, 2012 4:31 pm
Hey,
I also had this problem, and I don't think it will run fast. This is just to much juice for the Pi :lol:
I used lightspeed http.
Posts: 17
Joined: Wed Aug 08, 2012 8:54 pm
by ymiroshnyk » Tue Dec 18, 2012 10:07 am
I have the same issue on owncloud 4.5.
Thanks for tip with 'php-apc' now it works much faster.
I'll try to dig dipper and make it work even faster.
Posts: 1
Joined: Tue Dec 18, 2012 9:58 am
by recantha2 » Sun Oct 06, 2013 1:07 pm
php-apc helped improve matters with Wordpress/Nginx set-up too
--
Michael Horne - @recantha
Pi blog - http://www.recantha.co.uk/blog

Cambridge Raspberry Jam
Website: http://camjam.me
Facebook: https://www.facebook.com/cambridgeraspberryjam
Follow the Cambridge Raspberry Jam on Twitter - @cambridgejam
User avatar
Posts: 210
Joined: Wed Nov 14, 2012 9:34 am
Location: Potton, Bedfordshire
by rydwan » Mon Nov 11, 2013 3:29 pm
SOLUTION:

PHP-APC + Fast CGI

Tutorial: http://c-mobberley.com/wordpress/index.php/2013/04/30/raspberry-pi-web-server-speed-optimisation-for-slow-wordpress-owncloud-issues/

You can try also others tips like :
  1. overclock rpi
  2. disable unneeded owncloud apps
  3. ram disk (risk - data lost possile)
Posts: 1
Joined: Mon Nov 11, 2013 3:10 pm
by a9971256 » Mon Nov 11, 2013 10:39 pm
This is really wierd! On my OwnCloud installation, loading the index homepage takes around 30 seconds. However, when I load any page, it takes between 1 and 5 seconds. Does anyone know why this is happening? I don't suspect that the index page is that resource-intensive!
Posts: 43
Joined: Fri Jun 07, 2013 11:02 pm
by munkee1337 » Sun Dec 29, 2013 8:41 am
Try seafile instead it has a build for the pi loads better than owncloud http://c-mobberley.com/wordpress/index. ... pberry-pi/
Posts: 6
Joined: Sun Apr 14, 2013 12:16 pm
by nuller » Mon Feb 03, 2014 11:04 pm
I suggest to use apc, memcache - these technologies will speed things up (not on the first request, of course).
BUT there is some thing, that i didnt find in any forums... it's tweak owncloud itself.
One thing is owncloud/config/config.php: 'enable_previews' => false,
Cause every time you open some dir from web - owncloud will create preview - this takes a lot of resources and time.
Also apc tuning is necessary: in apc.ini (/etc/php5/conf.d)
extension=apc.so
apc.enabled = 1
apc.include_once_override = 0
apc.shm_size = 32M

sometimes it is necessary to clear apc cache (run from shell: php -r "apc_clear_cache();")

btw. I use owncloud 6.0.1
Posts: 1
Joined: Mon Feb 03, 2014 10:50 pm
by dosch » Tue Feb 04, 2014 11:29 pm
I upgraded my SD card from cat4 to cat10.
THAT made a big difference
Posts: 12
Joined: Sun Nov 17, 2013 2:33 pm
by ryancorvetti » Sun Jul 13, 2014 11:35 am
Enable PHP OPcache... http://php.net/manual/en/book.opcache.php

Doing this cut load time in half for me (even after applying the other optimizations recommended in this thread).
Posts: 1
Joined: Sun Jul 13, 2014 11:25 am
by cyrano » Sun Jul 13, 2014 5:46 pm
a9971256 wrote:This is really wierd! On my OwnCloud installation, loading the index homepage takes around 30 seconds. However, when I load any page, it takes between 1 and 5 seconds. Does anyone know why this is happening? I don't suspect that the index page is that resource-intensive!



Sounds a bit like you might have a problem in your browser. Authentication springs to mind...

OwnCloud's main page is never a speed demon. But it should load faster on a local subnet. And other optimizations never hurt, of course.
User avatar
Posts: 553
Joined: Wed Dec 05, 2012 11:48 pm
Location: Belgium