August 7, 2011 at 12:06 am
· Filed under Performance, Search Engine Optimization
For quite some time Google is considering web site performance a critical factor in search rankings. Recently a list of most-asked questions is published by Strangeloop in which they have discussed some frequently asked questions how Google factors web site performance into its search rankings.
One of the point they discussed
Q: Do they measure pages marked as non-crawlable?
Yes. They measure pages your users use, not what you have told Google is crawlable
So it means, the pages you mentioned not to crawl by Google in robots.txt or using meta tag noindex is not honored by Google if these are being visited by users (given the users have Google toolbar installed).
Many sites have some reporting tools which run on the same domain name and most of the reports take time to generate. It'll definitely impact your search ranking if you have Google toolbar installed in the browser where you are viewing reports. To stop impacting this on your search ranking you can either uninstall Google toolbar or disable PageRank feature. This tip has improved search ranking of my friend's site.
Permalink
August 4, 2011 at 11:53 pm
· Filed under Miscellaneous
Are you fed-up of updating status to multiple social platforms? Don't worry, Hellotxt is a cool service to update your status to multiple services. This will save a lot of your time.
Permalink
July 30, 2011 at 1:23 am
· Filed under News, Performance
Google has launched another performance centric service i.e. Page Speed Service. It seems to be the content delivery service which other CDNs are providing with a difference by doing some performance tuning i.e. concatenating CSS and some other tasks which are also performed by Google's mod_pagespeed. By providing this service, Google will always have updated content for its services like Google search and AdSense. Let's see how Google plan this service future.
Permalink
July 17, 2011 at 4:17 pm
· Filed under .htaccess, Apache, PHP
Yesterday I needed to increase the value of upload_max_filesize for a site's admin script/page while other pages of the size didn't require that. It is really easy to do it by using Apache's Files directive in .htaccess for a specific file with the below code.
<Files my.php>
php_value upload_max_filesize 10M
</Files>
Permalink
June 22, 2011 at 12:22 am
· Filed under Miscellaneous
Hello,
I just created an account on www.quora.com. Quora is a collection of questions and answers. It is open for some countries and for some it is invite only. If you need an invitation, just send me a message on twitter or post a comment here.
Permalink
February 20, 2011 at 8:10 am
· Filed under MySQL, News
MySQL recently fixed a known bug (I was not aware of this before) of OPTIMIZE TABLE (in MySQL Server 5.1.55, 5.5.9) in which OPTIMIZE TABLE statement was not preserving the AUTO_INCREMENT counter on OPTIMIZE TABLE operation.
Want to see yourself? Lets do it (code taken from the MySQL bug report)
CREATE TABLE a (a INTEGER PRIMARY KEY NOT NULL AUTO_INCREMENT) ENGINE=INNODB;
INSERT INTO a VALUES ();
INSERT INTO a VALUES ();
INSERT INTO a VALUES ();
DELETE FROM a ;
SHOW TABLE STATUS LIKE 'a';
In the below table status, you can see the AUTO_INCREMENT value is 4 (even after deleting all the rows which is normal behavior).
mysql> SHOW TABLE STATUS LIKE 'a'\G
*************************** 1. row ***************************
Name: a
Engine: InnoDB
Version: 10
Row_format: Compact
Rows: 3
Avg_row_length: 5461
Data_length: 16384
Max_data_length: 0
Index_length: 0
Data_free: 4194304
Auto_increment: 4
Create_time: 2011-02-20 07:52:18
Update_time: NULL
Check_time: NULL
Collation: latin1_swedish_ci
Checksum: NULL
Create_options:
Comment:
1 row in set (0.00 sec)
Now execute the OPTIMIZE TABLE command and check the table status
OPTIMIZE TABLE a;
SHOW TABLE STATUS LIKE 'a';
mysql> SHOW TABLE STATUS LIKE 'a'\G
*************************** 1. row ***************************
Name: a
Engine: InnoDB
Version: 10
Row_format: Compact
Rows: 0
Avg_row_length: 0
Data_length: 16384
Max_data_length: 0
Index_length: 0
Data_free: 4194304
Auto_increment: 1
Create_time: 2011-02-20 07:52:18
Update_time: NULL
Check_time: NULL
Collation: latin1_swedish_ci
Checksum: NULL
Create_options:
Comment:
1 row in set (0.00 sec)
MySQL fixed this bug 5 years after the bug report.
So be careful with OPTIMIZE TABLE if you have older MySQL versions.
TRUNCATE TABLE reset the AUTO_INCREMENT to 1 so don't confuse this example with TRUNCATE TABLE.
Permalink
January 30, 2011 at 8:05 pm
· Filed under PHP
There are many sites out there which tell you your own IP address. But all of them show you some ads, take some time to load and consume bandwidth (not a problem now a days). I decided to create one for my own use due to this. I thought to share the code and URL with you.
PHP's $_SERVER ($_SERVER is an array containing information such as headers, paths, and script locations. The entries in this array are created by the web server) came to my help. I used REMOTE_ADDR, because I don't need the IP behind the proxy at the moment. Here is the code to get the IP address
echo "IP: ". $_SERVER['REMOTE_ADDR'];
Here is the URL (http://ip.mwasif.com) to know your IP address.
REMOTE_ADDR: The IP address from which the user is viewing the current page.
HTTP_X_FORWARDED_FOR: The IP address of the user behind proxy. Becareful while using this, sometimes it may return user's LAN address.
Permalink
January 21, 2011 at 12:15 am
· Filed under MySQL
MySQL does not provide any native function to count the number of times a specific word exists in a column or string. But you can do it yourself by using MySQL string functions LENGTH() and REPLACE(). e.g. you have a column description and want to count number of instances of a word 'iPhone'. This query will return the number of occurrences of word iPhone.
SELECT (LENGTH(description) - LENGTH(REPLACE(description,'iPhone',''))) / LENGTH('iPhone')
FROM table
Permalink
January 19, 2011 at 12:19 am
· Filed under MySQL, News
I just attended MySQL webinar "What's New: MySQL 5.5 and MySQL Enterprise Edition". You may find the recording of this webinar at mysql.com. It was nice to see improved InnoDB performance (10x) as compared to MySQL 5.1 InnoDB. A couple of people in the webinar reported that they have experienced the enhanced performance with MySQL 5.5.
Here are some of the questions that looked interesting to me
Q: you have comparion charts between myisam and innodb?
A: We've just completed our MyISAM and InnoDB benchmarking and will be posting a whitepaper this week.
Q: Can you compare MySQL 5.5 partitioning schemas and performance with MS SQL Server 2008?
A: I'd recommend the following whitepaper for details: http://www.mysql.com/why-mysql/white-papers/mysql_wp_partitioning.php
Q: Are there any linux graphs/stats with using 2 or 4 core CPU's? The previous linux graphs were with 6 cores.
A: Here is a link to additional details regarding some of the benchmarks. Many of them start w/ 4 cores enabled and then expand to additional cores. As 2 cores scaled well with previous version, I believe most benchmarks started with 4 cores: http://assets.en.oreilly.com/1/event/36/What_s New in MySQL 5_5__ Performance and Scalability Benchmarks Presentation.pdf
Q: The white paper referenced for partitions is for 5.1. I am interested in the features and extensions that have been implemented in 5.5 A. Is there a newer white paper? Thanks
Q: Yes -- Here are improvements for 5.5 regarding partitioning http://dev.mysql.com/tech-resources/articles/mysql_55_partitioning.html
Q: Does MySQL support sub-partitioning ?
A: Yes http://dev.mysql.com/doc/refman/5.5/en/partitioning-subpartitions.html
Q: Is there any testing data available that focuses on the improved innodb performance in a virtual/cloud environment rather then the larger multi-core physical testing platforms noted in the presentation
A: I'd recommend reviewing the detailed presentation posted from our users conf: http://www.mysql.com/news-and-events/on-demand-webinars/display-od-532.html
Permalink
January 16, 2011 at 1:51 am
· Filed under .htaccess, Apache, PHP
You can remove PHPSESSID from URL by changing session.use_trans_sid value in php.ini, .htaccess (Apache) or in PHP code.
In php.ini set the value of session.use_trans_sid to 0
session.use_trans_sid = 0
In .htaccess
php_value session.use_trans_sid 0
In PHP code set the use_trans_sid value to false like below
ini_set('session.use_trans_sid', false);
Permalink
January 9, 2010 at 12:00 am
· Filed under MySQL
Today I found a couple of useful articles about upgrading MySQL 4. One is written by Peter Zaitsev and other by Guillaume Lefranc.
They are talking about problems you may face while upgrading as well as benefits of MySQL 5.
I hope you guys can really benefit from it.
Permalink