Here is the code beeing called by 100s users every second:
$db = mysql_connect($host, $user, $pass);
mysql_select_db($dbname, $db) or exit;
if(isset($_COOKIE[$_GET['a']]) == false){
setcookie ($_GET['a'], "b", time() + 5000, "/");
$ip = getenv('REMOTE_ADDR');
$sql = "INSERT INTO table (ip, count) VALUES ('$ip', '1')";
$query = mysql_query($sql);
}
mysql_close($db);
exit;
I use it to collect banner views and the 'table' is a Memory table to store fast... dont understand why its making the server go slow....?