Author |
Message |
Raven
Site Admin/Owner

Joined: Aug 27, 2002
Posts: 17088
|
Posted:
Tue Feb 13, 2007 6:40 pm |
|
This should work on 2.4 versions also but may need to be tweaked.
This change in includes/nukesentinel.php will have noticeable effects on your MySQL server load, especially if you have a fairly active site. And even if your site is not yet fairly active, your MySQL server will appreciate the relief
In includes/nukesentinel.php
[FIND]
// IP Tracking
[THEN FIND]
$checkrow = $db->sql_numrows($db->sql_query("SELECT ip_lo FROM `".$prefix."_nsnst_ip2country`"));
[REPLACE WITH]
$checkrow = $db->sql_numrows($db->sql_query("SELECT ip_lo FROM `".$prefix."_nsnst_ip2country` LIMIT 0,1"));
If your code does not look exactly like the above, you will still want to modify it, according to your code, to use the LIMIT clause. |
|
|
|
 |
Gremmie
Former Moderator in Good Standing

Joined: Apr 06, 2006
Posts: 2415
Location: Iowa, USA
|
Posted:
Tue Feb 13, 2007 8:43 pm |
|
If you run without any IP2Country data ($bypassNukeSentinelInvalidIPCheck = true), will this have any effect on performance? |
_________________ Only registered users can see links on this board! Get registered or login! - An Event Calendar for PHP-Nuke
Only registered users can see links on this board! Get registered or login! - A Google Maps Nuke Module |
|
|
 |
Raven

|
Posted:
Tue Feb 13, 2007 9:14 pm |
|
|
|
 |
Dawg
RavenNuke(tm) Development Team

Joined: Nov 07, 2003
Posts: 928
|
Posted:
Wed Feb 14, 2007 8:40 am |
|
Anything that helps the server is a happy thing....
Dawg |
|
|
|
 |
PeNdEjO
New Member


Joined: Jan 15, 2006
Posts: 1
Location: Buenos Aires
|
Posted:
Fri Feb 23, 2007 1:21 pm |
|
Nice, thxs Raven ^_^ |
_________________ BoA - ßêㆠøƒ Ãηgêl(tm) |
|
|
 |
fade2gray
Regular


Joined: Mar 26, 2006
Posts: 87
Location: UK
|
Posted:
Thu Jun 14, 2007 5:47 pm |
|
Does this still apply to 2.5.08? Because if it does, the nearest I can find is...
$checkrow = $db->sql_numrows($db->sql_query("SELECT * FROM `".$prefix."_nsnst_ip2country`"));
... in the "function write_ban($banip, $htip, $blocker_row)" code block, but it's "miles" below "// IP Tracking".
Should I change that to...
$checkrow = $db->sql_numrows($db->sql_query("SELECT * FROM `".$prefix."_nsnst_ip2country`LIMIT 0,1"));  |
|
|
|
 |
warren-the-ape
Worker


Joined: Nov 19, 2007
Posts: 196
Location: Netherlands
|
Posted:
Wed Dec 26, 2007 6:15 am |
|
^ With above
I can only find
Code:$checkrow = $db->sql_numrows($db->sql_query("SELECT * FROM `".$prefix."_nsnst_ip2country`"));
|
that 'ip_lo' is missing.
Does this still apply to 2.5.14? |
|
|
|
 |
nimis
Hangin' Around

Joined: Dec 13, 2007
Posts: 37
Location: New York, Bklyn
|
Posted:
Fri Feb 29, 2008 9:12 am |
|
Raven wrote: | This should work on 2.4 versions also but may need to be tweaked.
This change in includes/nukesentinel.php will have noticeable effects on your MySQL server load, especially if you have a fairly active site. And even if your site is not yet fairly active, your MySQL server will appreciate the relief
In includes/nukesentinel.php
[FIND]
// IP Tracking
[THEN FIND]
$checkrow = $db->sql_numrows($db->sql_query("SELECT ip_lo FROM `".$prefix."_nsnst_ip2country`"));
[REPLACE WITH]
$checkrow = $db->sql_numrows($db->sql_query("SELECT ip_lo FROM `".$prefix."_nsnst_ip2country` LIMIT 0,1"));
If your code does not look exactly like the above, you will still want to modify it, according to your code, to use the LIMIT clause. |
Hi Raven.. after browsing thru the forum I came upon you post above..
Iam running RavenNuke_v2.20.00 with NukeSentinel(tm) 2.5.16.
Checking my nukesentinel.php I found that it's different to what you said should be found and replaced
Code:[THEN FIND]
$checkrow = $db->sql_numrows($db->sql_query("SELECT ip_lo FROM `".$prefix."_nsnst_ip2country`"));
|
My nukesentinel.php does not have ip_lo but contains the following
Code:$checkrow = $db->sql_numrows($db->sql_query("SELECT * FROM `".$prefix."_nsnst_ip2country`"));
|
and wounder if editing it to
Code:[REPLACE WITH]
$checkrow = $db->sql_numrows($db->sql_query("SELECT ip_lo FROM `".$prefix."_nsnst_ip2country` LIMIT 0,1"));
|
would better MySQL server load ?
Thx in advance.. |
|
|
|
 |
montego
Site Admin

Joined: Aug 29, 2004
Posts: 9457
Location: Arizona
|
Posted:
Sat Mar 01, 2008 7:20 am |
|
Try just adding the LIMIT 0,1 first, which was the important part of the change. Since it is only going to return on row, limiting the size to just that one field doesn't help much. |
_________________ Only registered users can see links on this board! Get registered or login!
Only registered users can see links on this board! Get registered or login! |
|
|
 |
Raven

|
Posted:
Sat Mar 01, 2008 11:07 am |
|
I'll let Bob know that it's missing and also will enter a Mantis issue and update svn. Only the LIMIT 0,1 is needed. |
|
|
|
 |
nimis

|
Posted:
Wed Mar 05, 2008 7:42 pm |
|
Got it sorted out.. thx for the help guys.. |
|
|
|
 |
dad7732
RavenNuke(tm) Development Team

Joined: Mar 18, 2007
Posts: 1242
|
Posted:
Sun Apr 20, 2008 8:11 am |
|
This tweak is dramatic in the speed increase. It is really not that noticeable if your site has a low to medium access rate. One of my RN sites gets over 350,000 accesses monthly and I can tell you that the speed increase in IP2C functions is quite noticeably much quicker. MySQL thanks you !!
Cheers, Jay |
|
|
|
 |
|