How to use Drupal 7 Pressflow

front-pressflow

Pressflow 7 is drupal distribution that will make your site amazingly fast. I started using Pressflow when it was first released in 2009. Pressflow is being used by some of the largest drupal sites in the world including data.gov.uk, wikimedia foundation, worldbank and a lot more.

“Pressflow addresses a long-standing problem: High-traffic sites use stable versions of Drupal, and stable versions of Drupal are ineligible for enhancements to solve performance bottlenecks discovered after widespread deployment. by Pressflow”

 

Before pressflow we encountered a lot or performance and scalability issues in one our projects. Its an online news site running on drupal 6, that should be capable of handling 1M pageviews  a day(4 years ago). Currently, it can handle double the capacity the site,  its now the no. 1 News Online Site in the Philippines.

These are some of the issues that we encountered:

1. Apache freezing
2. Mysql Bottleneck
3. Content inconsistencies across all sites
4. Cache problems
5. Missing fields in the display

These problems were eliminated when we started using pressflow 6.  Now that Pressflow 7 is now out and ready for production, i would recommend using it if you are building a large scale applications.

Requirements:

1. Mysql Master-Slave Replication

2. Two remote/local servers with mysql and on it, i recommend using mysql 5.5 http://dev.mysql.com/doc/refman/5.5/en/replication-howto.html

3. Both server should have a running pressflow 7, using this codebase https://github.com/pressflow

How to:

1. Identify each servers ip address, make sure that both server is pinging each other by using Ping command, you may use virtual machine, remote vm or local physical servers, any of the three will do.

2. Edit the my.cnf or my.ini of your master database server and add the following linesand restart the database server:

server-id = 1                                                                                                                                                                     log-bin = mybin-log

Screenshot_9_8_13_6_11_PM

 

 

 

 

3. Edit the my.cnf of my.ini of you slave database server and add the following lines and restart the database server:

server-id = 2

Screenshot_9_8_13_6_09_PM

 

 

 

 

4. Go to Master database server and login as root, create a user for replication see below:

1111

5. Still on Master server, execute the commands below:

Screenshot_9_8_13_6_29_PM

This is showing the current bin file and the log position which is important in the starting the replication.

6. Go to Slave database server login in the console and execute the below commands:

4444

7.  To know if slave is now replicating properly:

3333

8. Now you need to configure the pressflow slave and master database on each settings.php. Refer to the below figure.

5555

9. Now you can be able to create contents on either of the two servers without having a replication break.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s