Forums | Mahara Community

Developers /
Mahara migration site slow


anonymous profile picture
Deleted user
Posts: 6

28 March 2015, 12:41 AM

Hi All,

I am trying to move Mahara to a different server , mainly moving the host name, MYSQL server to MariaDB Server and to a newer php version.

This is what I have done till now :

took a backup of the mysql database using mysqldump

transferred the mahara data store using rsync

copied over the source code using git

The problem i seem to be facing is some pages such as groups / user pages take a long time to load ( > 5 minutes) whereas all the admin pages are loaded almost instantly. 

I have also followed the guide to re-generate the public key again for the new server.

 

Would anyone have any pointers as to why the migrated site is so slow on some pages ? Doing a fresh install of Mahara on the same server seems to work fine so I'm thinking its something to do with the migrated data .

anonymous profile picture
Deleted user
Posts: 6

28 March 2015, 5:19 AM

It seems like the clicking on an individual group  takes the longest ( more than 5 minutes) to load.  Is it something that I need to those with those tables with respect to migration ? 

Robert Lyon's profile picture
Posts: 416

28 March 2015, 8:21 AM

Hi Hittesh,

The first thing I'd check is that all the correct indexing was present on the migrated database's tables

CheersRobert

anonymous profile picture
Deleted user
Posts: 6

28 March 2015, 8:49 AM

I see there is indexing present on the migrated groups table: 

 

Keyname Type Unique Packed Column Cardinality Collation Null Comment

PRIMARY BTREE Yes No id 85 A No
 grou_nam_uk BTREE Yes No name 85 A No
grou_inssho_uix BTREE Yes No institution 4 A Yes
shortname 85 A Yes
grou_url_uix BTREE Yes No urlid 85 A Yes
grou_gro_ix BTREE No No grouptype 4 A No
grou_cat_ix BTREE No No category 2 A Yes
grou_ins_ix BTREE No No institution 4 A Yes

Aaron Wells's profile picture
Posts: 896

30 March 2015, 11:32 AM

A couple of things you could try:

1. Do an "analyze table" or "optimize table": http://stackoverflow.com/questions/5474662/mysql-optimize-all-tables

2. Do a schema diff against a clean install of Mahara, to make sure all your indexes and such are present as they should be. (Though I think mysqldump would copy all that stuff properly.)

3. Check your mariadb configuration to see if you can get some performance improvements that way.

Cheers,

Aaron

anonymous profile picture
Deleted user
Posts: 6

30 March 2015, 10:34 PM

Hi Aaron,

Many thanks for your pointers.

  1. I did a mysqlcheck -o on the migrated mahara db . http://pastebin.com/TGfCy4SY
  2. I did a mysqldiff between the old mahara server db and the new one . No difference
  3. I did a mysqldiff between the fresh install mahara db and the migrated mahara db on the new server . I see quite a few differences but they seem trivial. Again, I'm attaching a diff file if you could spot anything worth changing. http://pastebin.com/zsPE0GWp
  4. For the mariadb configuration, I am not really a dba so I really wouldn't know what to tinker with to speed the server up. Any suggestions are welcome as I have root access to it

Thanks again

Hittesh

Aaron Wells's profile picture
Posts: 896

31 March 2015, 1:47 PM

Hi Hittesh,

Based on the schema diffs you've done, it looks like all the migrations went correctly.

So, unfortunately I'm out of ideas. I'm not much of a DBA either. ;)

MariaDB is supposed to be a "drop-in replacement" for MySQL, so I'm stumped as to why your site is running slower after this migration. Since the structures are all correct, it looks like it's a MariaDB problem rather than a Mahara problem, so I'd suggest asking for help in a MariaDB forum. Mahara doesn't do anything exotic with the database, so general-purpose MariaDB advice should apply.

Cheers,

Aaron

01 April 2015, 5:01 AM

Hi Hittesh,

I don't know if you have change that but if you have put your session on an NFS storage it's possible that you get bad performance.  We ran into this problem.

Also you can use a PHP profiler to be sure that MariaDB is the problem.

Bye

Steve

anonymous profile picture
Deleted user
Posts: 6

17 April 2015, 2:26 AM

Hi Steve,

I'm not sure NFS is the problem as I have not included the filestore yet. I have also done a xhprof profiling and that indicates that it get particularly slow when it has to load the profile icon on some pages such as groups, artefacts etc. Please find attached a callgraph for that page.

 

http://postimg.org/image/k784rz4yr/

 

Just though I'll also mention that I.m using $cfg->sessionpath = '/tmp/mahara-sessions'; to store my sessions in a different place but my OS , centOS chooses to create a /tmp/systemd-private-xxxxx/tmp/<mahara_session_folders> .

Is this something to worry about ?

 

Thanks,

Hittesh

anonymous profile picture
Deleted user
Posts: 6

17 April 2015, 9:23 PM

Mystery solved. 

It was the gravatar service that my newly created server didnt have outbound access to !!! 

 

Reasons to turn it off

This option requires both the user and the web server to have access to the Gravatar server (http://www.gravatar.com or https://secure.gravatar.com). In installations such as locked-down intranets, where such access is not available, enabling this option would simply add extra delays.

 

Thanks all for your help!

 

 

Hittesh

11 results