Patch hỗ trợ nén dữ liệu truyền tải giữa webserver & database server; Áp dụng cho trường hợp web server và database server "không" nằm chung một máy:
Index: includes/database.mysql.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/database.mysql.inc,v
retrieving revision 1.85
diff -u -r1.85 database.mysql.inc
--- includes/database.mysql.inc 19 Dec 2007 13:03:16 -0000 1.85
+++ includes/database.mysql.inc 22 Dec 2007 05:13:05 -0000
@@ -77,9 +77,12 @@
// mysql_connect() was called before with the same parameters.
// This is important if you are using two databases on the same
// server.
- // - 2 means CLIENT_FOUND_ROWS: return the number of found
+ // - MYSQL_CLIENT_FOUND_ROWS: return the number of found
// (matched) rows, not the number of affected rows.
- $connection = @mysql_connect($url['host'], $url['user'], $url['pass'], TRUE, 2);
+ // - MYSQL_CLIENT_COMPRESS: compress the data sent from MySQL server
+ // to the client. This can speed things when MySQL and PHP are on
+ // different servers and have a relatively slow link.
+ $connection = @mysql_connect($url['host'], $url['user'], $url['pass'], TRUE, MYSQL_CLIENT_FOUND_ROWS|MYSQL_CLIENT_COMPRESS);
if (!$connection || !mysql_select_db(substr($url['path'], 1))) {
// Show error screen otherwise
_db_error_page(mysql_error());