Hi
I am currently testing my website locally on a Windows machine using Apache & MySQL .. the live website is hosted on linux with almost identical versions of Apache and MySQL.
I have been calculating page generation times as the sites pages are made from included php classes and functions. For the best part the page generation times on the windows and linux box have been very similar (about 0.001secs).
I added a search engine to the site which queries a MySQL database and the page generation time was again very similar between windows and linux based apache servers (still being about 0.001).
However I have recently added an IP tracking script to the site which queries the database to provide the country where the user is from. Since installing this script page generation time has only increased a small amount on the linux (box - < 0.002secs) whilst my testing server (apache on windows) is showing a significantly higher page generation time at 0.09 seconds.
The crux of the MySQL query for the IP tracker is:
$country_query = "SELECT country_code,country_name FROM geotargetting "
. "WHERE ip_from<=inet_aton('$clientIP') "
. "AND ip_to>=inet_aton('$clientIP') ";
// Executing above query
$country_exec = mysql_query($country_query);
$ccode_array = mysql_fetch_array($country_exec);
$country_code = $ccode_array['country_code'];
$country_name = $ccode_array['country_name'];
Can anyone account for why/is it normal for mysql queries of this nature to be slower on the windows system.