OwnCloud Performance Tweaks

Tutorials on ownCloud administration
Forum rules
You may post your own tutorials here. Please keep in mind that a moderator has to approve it before everybody can read it!

OwnCloud Performance Tweaks

Postby nairda » Mon Apr 22, 2013 2:41 pm

I want to gather some performance tweaks for ownCloud (with some also apply-able to general php-applications, too). I have found some of this in different topics in this forum or elsewhere.

1) What: Install a PHP-Accelerator (php-apc recommended)
Why: Wikipedia promises about 3x faster page generation.
How: # apt-get install php-apc
You can check the php-apc settings by calling phpinfo() in a php-file. There should appear a section named APC.

2) What: Activate Cronjobs
Why: Per default owncloud executes background tasks by executing one each time a page is loaded. This slows down response times. By decoupling one from the other, response times should get better.
How: http://doc.owncloud.org/server/5.0/admi ... #cron-jobs

3) What: Activate serve static files option
Why: It should improve performance when transferring big files (>100mb)
How: Read here: http://doc.owncloud.org/server/5.0/admi ... dfile.html

4) What: Deactivate unnecessary modules
Why: Even if you don't use the calender the contacts-app, or any other app, they take performance. The amount depends on the app but e.g. lucene (the "Full Text Search"-module) can take quite a big amount.
How: Go to the Apps-Page and click "Disable" for modules you don't need.

5) What: (Windows-only) Change localhost in config.php to 127.0.0.1
Why: http://stackoverflow.com/questions/3715 ... -127-0-0-1
How: http://forum.owncloud.org/viewtopic.php?f=17&t=7559

6) What: Install ntp (Actually not a performance tweak, but nevertheless useful)
Why: To ensure that the server always has the correct time. This is crucial to see which file was written last and to have it replicated the right way.
How: with debian, it's just "apt-get install ntp". Done. For other distributions or windows, ask google.

7) What: make symbolic link in data-directory of administrator to the owncloud.log-file
Why: To be able to view it in full and download it from the webinterface
How: something similar to
Code: Select all
ln -s /var/www/owncloud/data/owncloud.log /var/www/owncloud/data/admin/files/owncloud.log

8) What: RTFM for your server
Why: Because they know best how to tweak performance
How: Look here: [Apache 2.2] [Apache 2.4] [nginx]
Nginx even references an owncloud installation guide in its manual.

Please participate.
I would like this collection to get more comprehensive in time, and I'd like to see some "how to secure your server"-collection of hints too.

//edit: added point 6 and 7 because, although they don't really impact performance, they are quite useful to me.
//edit2: added point 8
(mostly) inactive, formerly running owncloud 5 - 5.0.12 on an Apache 2.2/PHP 5.3.3 using a PostgreSQL 8.4 on a Debian 6 (squeeze) server serving 11 users
nairda
Starter
 
Posts: 71
Joined: Mon Apr 22, 2013 12:44 pm

Re: OwnCloud Performance Tweaks

Postby Rancor » Mon May 13, 2013 2:14 pm

Additional when using a MySQL database optimizing the my.cnf could provide some performance boost.

There are two scripts available for a basic optimization of a MySQL database:

Tuning Primer
https://launchpad.net/mysql-tuning-primer

MySQLTuner
https://github.com/rackerhacker/MySQLTuner-perl

Additional performance hints can be found via google:

http://lmgtfy.com/?q=mysql+performance+optimization
Rancor
OwnCloud master
 
Posts: 5975
Joined: Sat May 26, 2012 2:00 pm
ownCloud version: 6.0.2
Webserver: nginx
Database: MySQL
OS: Linux
PHP version: 5.4.x

Re: OwnCloud Performance Tweaks

Postby xavierle » Mon May 13, 2013 3:52 pm

seems to be a very good startpoint for performance
thanks
xavierle
Beginner
 
Posts: 14
Joined: Sat May 11, 2013 5:47 am
ownCloud version: 5.0.5
Webserver: Apache
Database: MySQL
OS: Linux
PHP version: 5.3

Re: OwnCloud Performance Tweaks

Postby Onnonymous » Sat Aug 24, 2013 10:33 am

It might be worthwhile to add that small files are slower than big files. On my Raspberry Pi (I know, I know) a 0 byte file takes 12 seconds to upload! In ganglia I see that the bandwidth for small files is not utilized. When big files (30MB) are transferred, bandwidth jumps up two orders of magnitude. So if you have lots of very small files that you don't change often, it might be a good idea to zip or tar them.
Onnonymous
Newbie
 
Posts: 1
Joined: Sat Aug 24, 2013 9:21 am
ownCloud version: 5.0.10
Webserver: Apache
Database: MySQL
OS: Linux
PHP version: 5.4.4-14+deb7u3

Re: OwnCloud Performance Tweaks

Postby nairda » Wed Sep 11, 2013 9:00 am

I now decided to install owncloud on top of nginx (on my raspberry pi b). The performance is not too bad, but the initial latency when I initially open the page is quite high. I followed this tutorial:
http://www.forum-raspberrypi.de/Thread- ... -webserver

It's german, but it also contains quite a few performance improvements like php-apc, memchached, php-fpm and varnish.

I can confirm the issue that small files are comparably slow on raspberry pi.
(mostly) inactive, formerly running owncloud 5 - 5.0.12 on an Apache 2.2/PHP 5.3.3 using a PostgreSQL 8.4 on a Debian 6 (squeeze) server serving 11 users
nairda
Starter
 
Posts: 71
Joined: Mon Apr 22, 2013 12:44 pm

Re: OwnCloud Performance Tweaks

Postby _KaszpiR_ » Mon Oct 28, 2013 5:42 pm

If you have Apache configured with mod_fcgid then you may have to update also the FcgidMaxRequestLen variable, to be able to upload bigger files. More about it here http://httpd.apache.org/mod_fcgid/mod/mod_fcgid.html

You can change it per vhost or globally in apache2/mods_enabled/fcgid.conf

<IfModule mod_fcgid.c>
AddHandler<-->fcgid-script .fcgi
FcgidConnectTimeout 20
PHP_Fix_Pathinfo_Enable 1
# php PUT request, for file upload over., max upload 16GB
FcgidMaxRequestLen 17179869184
</IfModule>

Remember also to increase PHP upload limits accordingly.
User avatar
_KaszpiR_
Newbie
 
Posts: 2
Joined: Mon Oct 28, 2013 5:36 pm
ownCloud version: 5.0.4
Webserver: Apache
Database: MySQL
OS: Linux Hosting Package
PHP version: PHP 5.3.10-1ubuntu3.

Re: OwnCloud Performance Tweaks

Postby tdkonsta » Sun Jan 26, 2014 12:18 pm

I would suggest also to serve compressed files.
This goes to step 8.
Code: Select all
/etc/nginx/nginx.conf
        ##
        # Gzip Settings
        ##

        gzip on;
        gzip_disable "msie6";

         gzip_vary on;
         gzip_proxied any;
         gzip_comp_level 6; //Choose your preferred level
         gzip_buffers 16 8k;
         gzip_http_version 1.1;
         gzip_types  image/svg+xml text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss   text/javascript;



Do not forget to add
Code: Select all
 image/svg+xml
on your gzip_types. Because by default svg files are not compressed by nginx.

Do the same on your nginx server block:
Taken from OwnCloud Docs
Code: Select all
        location ~* ^.+\.(jpg|jpeg|gif|bmp|ico|png|css|js|[b]svg[/b]|swf)$ {
                expires 30d;
                # Optional: Don't log access to assets
                access_log off;
        }

Also here you should add svg.
It's not a big thing but saves you some ms.

If i think of something else, i will post it here. Please to do the same.
tdkonsta
Newbie
 
Posts: 3
Joined: Wed Dec 25, 2013 1:44 pm
ownCloud version: 6.0.0a
Webserver: nginx
Database: MySQL
OS: Linux
PHP version: 5.4.4

Re: OwnCloud Performance Tweaks

Postby Rancor » Sun Jan 26, 2014 2:23 pm

Hi,

please don't use gzip compression with ownCloud as this is leading to issues when syncing files:

https://github.com/owncloud/mirall/issu ... t-32139281
Rancor
OwnCloud master
 
Posts: 5975
Joined: Sat May 26, 2012 2:00 pm
ownCloud version: 6.0.2
Webserver: nginx
Database: MySQL
OS: Linux
PHP version: 5.4.x

Re: OwnCloud Performance Tweaks

Postby Rancor » Mon Jan 27, 2014 6:57 pm

Ah, missed one point:

If you still want to use gzip compression you could report an issue against the ownCloud core:

https://github.com/owncloud/core/issues
Rancor
OwnCloud master
 
Posts: 5975
Joined: Sat May 26, 2012 2:00 pm
ownCloud version: 6.0.2
Webserver: nginx
Database: MySQL
OS: Linux
PHP version: 5.4.x

Re: OwnCloud Performance Tweaks

Postby mngeoservices » Fri Mar 07, 2014 9:37 pm

We found that the cache memory of our ownCloud server was getting completely filled. Adding a cron to clear the memory every half hour-hour was extremely helpful at improving performance.

I used the instructions here:
http://forums.zpanelcp.com/Thread-Cron- ... hed-Memory

However, your operating system and setup may be different.
mngeoservices
Newbie
 
Posts: 4
Joined: Wed Mar 05, 2014 4:23 am
ownCloud version: 6.0.1
Webserver: Apache
Database: MySQL
OS: Linux

Next

Return to Tutorials

Who is online

Users browsing this forum: No registered users and 5 guests