- OpenX Community Forums

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Maintenance On Multi Server Setup
amipani
post Oct 26 2011, 01:29 PM
Post #1


Beginner
*

Group: Members
Posts: 5
Joined: 16-September 10
Member No.: 139,661



We have installed openX on a multi server setup on the cloud.

Application code is rsynced locally from a central repository (NFS) every time a new instance is launched.

Image uploads and config is symlinked from each instance to the same central repository (NFS).

All nodes share a single DB.

We have setup the maintenance script to be triggered once per hour.

Maintenance is started via the web (cron job that hits the maintenance script via lynx).
Since we use load balancing a single server will run the maintenance every time (but it could be a different server every hour).

Is this ok? I mean is all data that is processed by the maintenance script in the DB or are there also files stored on the web server itself?

thanks in advance
Go to the top of the page
 
+Quote Post
rakshan
post Oct 26 2011, 05:55 PM
Post #2


Mentor
********

Group: Moderators
Posts: 1,303
Joined: 12-November 08
From: San Francisco
Member No.: 24,158



QUOTE (amipani @ Oct 26 2011, 02:29 PM) *
All nodes share a single DB.

Is this ok? I mean is all data that is processed by the maintenance script in the DB or are there also files stored on the web server itself?



In a distributed openx setup, each instance has its own local db which slaves off a master (except the data_bkt_ tables).

If you use a single db, arent you creating a bottleneck and point of failure?

All the stat data is in the db. maintenance only accesses the conf.php file for config info.
However, in a typical distributed setup, each server's db has local data_bkt tables and they run a different job called maintenance-distributed.php (or something, just check the directory)

Go to the top of the page
 
+Quote Post
amipani
post Oct 27 2011, 07:07 AM
Post #3


Beginner
*

Group: Members
Posts: 5
Joined: 16-September 10
Member No.: 139,661



True we dont have the typical distributed setup as for the time being the DB is not a bottleneck at all.


Many thanks for your answer!


Go to the top of the page
 
+Quote Post
OpenxLotfi
post Feb 10 2012, 01:40 PM
Post #4


Beginner
*

Group: Members
Posts: 2
Joined: 10-February 12
From: Paris
Member No.: 171,544



Hi.
We have the same confiugration as amipani.

I run a cron in which ./scripts/maintenance.php is called on each server at different time. Exactelly, My configuration is :
two webservers and one database server.
The cron calls maintenance script every two time in a hour. (in the first server we call the script each 15 and 45 minutes in each hour. in the second each 7 and 37 minutes in each hour).
But i noticed that every two hours and 3 minutes openx runs the maintenance script; This increases the connections number on my database server, and i got the too_many connections error.

I would like to know and understand why openx runs maintenance every two hours?
Is there a way to disable this automatic maintenance on one server.

what do you think?


Thanks for the help.
Go to the top of the page
 
+Quote Post
brendan_
post Feb 10 2012, 07:38 PM
Post #5


Beginner
*

Group: Members
Posts: 3
Joined: 10-February 12
Member No.: 171,548



By my reading of how it works, if there is only one database, there is no need to run the maintenance on each server. I have auto maintenance disabled on the live webservers, and a scheduled job on a separate server runs the maintenance each hour.

As far as I can tell, "Distributed Maintenance" has to do with a different sort of scenario than clustered webservers on a single database server.
Go to the top of the page
 
+Quote Post
OpenxLotfi
post Feb 14 2012, 03:19 PM
Post #6


Beginner
*

Group: Members
Posts: 2
Joined: 10-February 12
From: Paris
Member No.: 171,544



QUOTE (brendan_ @ Feb 10 2012, 08:38 PM) *
By my reading of how it works, if there is only one database, there is no need to run the maintenance on each server. I have auto maintenance disabled on the live webservers, and a scheduled job on a separate server runs the maintenance each hour.

As far as I can tell, "Distributed Maintenance" has to do with a different sort of scenario than clustered webservers on a single database server.



Thank you for the reply.



As i noticed in my post, i disabled the automatic maintenance on my servers a run it via a cron.
I would like to know how automatic mainetnance is ran every 2 hours?

On my Mysql server, at the time that automaintenance runs,
CODE

SHOW PROCESSLIST;
.
.
.
| 75710540 | openx | openx1.mydomain.com:42231 | openx | Query | 18 | Locked | INSERT INTO data_bkt_m (interval_start, creative_id, zone_id, count) VALUES ... |
| 75710564 | openx | openx2.mydomain.com:41428 | openx | Query | 18 | Locked | INSERT INTO data_bkt_m (interval_start, creative_id, zone_id, count) VALUES |
| 75710582 | openx | openx2.mydomain.com:41443 | openx | Query | 18 | Locked | INSERT INTO data_bkt_m (interval_start, creative_id, zone_id, count) VALUES |
+----------+-------+-------------------------+-------+---------+------+--------------+------------------------------------------------------------------------------------------------------+
1200 rows in set (0.00 sec)

The max_connections parameters on my server is reached at high visits period in a day.
This causes that my websites are not accessbile during 1 minute the time that the maintenance is terminated.

Do you have any idea to sort this issue?

Thank you
Go to the top of the page
 
+Quote Post
brendan__
post Feb 14 2012, 06:13 PM
Post #7


Beginner
*

Group: Members
Posts: 1
Joined: 14-February 12
Member No.: 171,578



The maintenance is necessary for various things. The documentation is unclear, but I know it does things with statistics and prioritization, among others.

First, make sure you are not running the maintenance on both servers, only one. Secondly, run it more frequently than every 2 hours. At least every hour, more if your traffic is that heavy.

According to the documentation, using the MyISAM engine can cause the locking to interfere with traffic on heavily-loaded servers. I'm not sure how heavy is heavy. I think ours are pretty busy and MyISAM seems to work fine. You could consider switching to the InnoDB engine, but if it's that high I would try running the maintenance every 5 minutes before making that switch.
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic

 

Locations of visitors to this page