MaxScale Problems with PHP Application ownCloud

569 views
Skip to first unread message

miro...@gmail.com

unread,
Mar 4, 2015, 3:04:23 AM3/4/15
to maxs...@googlegroups.com
Hi,

I've tested the following Configuration.

3 Web Servers with Apache 2.2, PHP 5.4, MaxScale 1.0.5 runnning on CentOS 6.6
2 MySQL Servers with Percona XTRADB Cluster running on CentOS 6.6

MaxScale is configured with galeramon to Read Write Split on the Galera Cluster. I choose MaxScale because if I use HAProxy to split the traffic to my MySQL Server I got a lot of DeadLocks, I splitted the Traffic with HAProxy on bothe MySQL Nodes.

Everything seems to work as expected on Commandline and with some Scripts but when I Configure the ownCloud Application, which is programmed in PHP, I see some strange behaviours.

Die httpd processes growing until they reached the maximum configured count, at this point the Web Server will not answer any request. I figured out that this Problem only occurs if I use MaxScale in my PHP application, if I go to the MySQL Servers directly this will not happen.

If I reload the Apache httpd Service a lot of the started processes vanishing. It seems that Apache or PHP cannot close the process properly.

Now I revert to HAProxy but I defined one of the MySQL Server as backup, so all traffic goes to one Server and the second is just a hot standby server.

Any tips ?

With best regards
Michael Roth

Markus Mäkelä

unread,
Mar 4, 2015, 3:16:43 AM3/4/15
to miro...@gmail.com, maxs...@googlegroups.com
Hi,

This seems like something that might be caused by connections not being
closed by the application. MaxScale by default doesn't idle time out
connections.

The part about the growing httpd process count does seem a bit odd but I
assume that is just a side effect of connections being kept open.

To enable idle timeouts, add the following parameter to the service:

connection_timeout=<idle timeout in seconds>.

If this does not help, you can configure the readwritesplit router to
drop connections that keep the same session open for too long and
execute too many statements that modify the session state. To enable
this, add the following parameter to the router_options of the service:

router_options=max_sescmd_history=<number of statements>

I'd try experimenting with those two parameters in the configuration
file and see if that helps with the growing number of processes.

Markus
--
Markus Mäkelä, Software Engineer
MariaDB Corporation
t: +358 40 7740484 | Skype: markus.j.makela

Markus Mäkelä

unread,
Mar 4, 2015, 3:26:21 AM3/4/15
to miro...@gmail.com, maxs...@googlegroups.com
A quick note about the last email. Those are only available of the
develop branch on GitHub and aren't a part of the 1.0.5 release of
MaxScale. My apologies for this mistake.

Markus

On Wed, 2015-03-04 at 00:04 -0800, miro...@gmail.com wrote:

miro...@gmail.com

unread,
Mar 5, 2015, 1:32:25 PM3/5/15
to maxs...@googlegroups.com
Hi,

Thank you for your prompt answers, I'll give it a try next week.

With best Regards
Michael Roth

sagar...@fosteringlinux.com

unread,
Feb 27, 2017, 12:42:53 AM2/27/17
to MaxScale, miro...@gmail.com

Hi ,

I need some help in connecting my php based webserver to maxscale when i am trying to connect to maxscale i cannot connect to database , but when i directly connect to my database it seems to get connected.(my db is mariadb)

Markus Mäkelä

unread,
Feb 27, 2017, 2:08:49 AM2/27/17
to maxs...@googlegroups.com

Hi,

Does the connection attempt give any error messages? Most of the time problems like this are caused by a lack of the proper grants for the user. As MaxScale is a proxy, you need to duplicate the grant information for user@client-ip as well as user@maxscale-ip. You can find more information in this tutorial: https://mariadb.com/kb/en/mariadb-enterprise/setting-up-mariadb-maxscale/

Markus

On 27/02/17 07:42, sagar...@fosteringlinux.com wrote:
Hi ,

I need some help in connecting my php based webserver to maxscale when i am trying to connect to maxscale i cannot connect to database , but when i directly connect to my database it seems to get connected.(my db is mariadb)


sagar Arora

unread,
Feb 27, 2017, 4:20:31 AM2/27/17
to Markus Mäkelä, maxs...@googlegroups.com
i have done the necessary changes but still issue persist i am not able to connect to maxscale from my app servers everytime i connect i gives error "Failed to connect to MySQL: Lost connection to MySQL server at 'reading initial communication packet', system error: 111"

--
You received this message because you are subscribed to a topic in the Google Groups "MaxScale" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/maxscale/0wpFP0Bx9lk/unsubscribe.
To unsubscribe from this group and all its topics, send an email to maxscale+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--

Best Regards,

Sagar Arora

DevOps Engineer

Keen&Able

M:+91-9971132611

E: Sagar....@fosteringlinux.com 

Reply all
Reply to author
Forward
0 new messages