formfields.com Forum Index formfields.com
FORMfields Forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Optimizing AdMan Performance

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    formfields.com Forum Index -> AM 1 - Frequently Asked Questions (FAQs)
View previous topic :: View next topic  
Author Message
formfields



Joined: 01 Aug 2005
Posts: 465

PostPosted: Wed Mar 01, 2006 3:58 pm    Post subject: Optimizing AdMan Performance Reply with quote

Some of our latest customers have reported that AdMan functions well even on their websites that receive around 400,000 page views daily. A few customers have reported slight server lag from using AdMan. Here are a few steps that you can take to decrease your server lag:
1. Place AdMan on a web server that is different from the web server hosting your website. Preferrably, this other web server would be a dedicated server on the same internal network as the web server hosting your website.
2. Do not use the Tracking Code to track each user's every step. This feature is resource intensive and is not required to service ads.
3. Use phpMyAdmin to move all older records (that are say older than a month of two) to a backup table like adman_ad_requests_bak.
4. If you are running a version of AM before 1.1, apply the Reports fix described at http://www.formfields.com/phpBB2/viewtopic.php?t=174.

We are currently investigating optimization through the Zend Optimizer. We will post more information when we have finished our investigation.


Last edited by formfields on Fri Dec 28, 2007 3:40 pm; edited 1 time in total
Back to top
View user's profile Send private message
formfields



Joined: 01 Aug 2005
Posts: 465

PostPosted: Fri Mar 03, 2006 8:38 pm    Post subject: Reply with quote

After doing some preliminary testing, we found that the majority of the server lag is the result of establishing a database connection every time an ad is serviced. At this point, we do not have a quick fix. We are planning on investigating the time cost in temporarily writing data to flat files instead of to the database. Then a maintenance script would be run once a day to enter this data into the database. Please check back here for this fix in the near future.

The secondary cause of server lag is from loading various PHP files each time an ad is serviced. We have already devised several simple schemes to reduce the amount of PHP files that are included during each ad request, however this improvement is irrelevant until the database bottleneck has been resolved.
Back to top
View user's profile Send private message
formfields



Joined: 01 Aug 2005
Posts: 465

PostPosted: Fri Jan 04, 2008 4:12 am    Post subject: Reply with quote

CLEARING OUT THE adman_ad_requests TABLE

Here is method to clean out your adman_ad_requests table periodically. Maintaining a smaller adman_ad_requests table greatly improves the performance of AdMan. Note: This procedure is only really useful if you have more than 1 million records in your adman_ad_requests table.

Every month or after about 1 million new adman_ad_requests you should:
a. Run phpMyAdmin
b. Select the database where your adman tables are stored
c. Click SQL and execute:
Code:

SELECT request_id FROM adman_ad_requests WHERE TO_DAYS(NOW())-TO_DAYS(ts)>60 ORDER BY ts DESC LIMIT 1

where 60 is roughly the amount of days it would take to acquire about 2 million adman_ad_requests. Copy the returned request_id.
d. Click SQL and execute:
Code:

DELETE FROM adman_ad_requests WHERE request_id<X

where X is the request_id that was returned in step c.
Note: We lookup the request id and then issue a DELETE as this is the fastest way to delete the oldest records. Speed must be maximized when working with large amounts of records.

-------------------------------------------------------

BACKING UP THE adman_ad_requests TABLE (OPTIONAL AND CAN BE TIME CONSUMING)

If you prefer to move your old adman_ad_requests to a backup table first, then:

Create a backup of the table:
Note: This step only has to be done one time.
a. Run phpMyAdmin
b. Select the database where your adman tables are stored
c. Select the adman_ad_requests table
d. Click Operations
e. Copy the adman_ad_requests table (structure only) to adman_ad_requests_bak

Copy the oldest records to the adman_ad_request table:
a. Run phpMyAdmin
b. Select the database where your adman tables are stored
c. Click SQL and execute:
Code:

SELECT request_id FROM adman_ad_requests WHERE TO_DAYS(NOW())-TO_DAYS(ts)>60 ORDER BY ts DESC LIMIT 1

where 60 is roughly the amount of days it would take to acquire about 2 million adman_ad_requests. Copy the returned request_id.
d. Click SQL and execute:
Code:

INSERT INTO adman_ad_requests_bak SELECT * FROM adman_ad_requests WHERE request_id<X

where X is the request_id that was returned in step c.
Back to top
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    formfields.com Forum Index -> AM 1 - Frequently Asked Questions (FAQs) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group