Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Ravens PHP Scripts And Web Hosting Forum Index -> NukeSentinel(tm) v2.5.x
Author Message
Raven
Site Admin/Owner



Joined: Aug 27, 2002
Posts: 17088

PostPosted: Tue Feb 13, 2007 6:40 pm Reply with quote

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 Smile

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.
 
View user's profile Send private message
Gremmie
Former Moderator in Good Standing



Joined: Apr 06, 2006
Posts: 2415
Location: Iowa, USA

PostPosted: Tue Feb 13, 2007 8:43 pm Reply with quote

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 
View user's profile Send private message
Raven







PostPosted: Tue Feb 13, 2007 9:14 pm Reply with quote

None at all.
 
Dawg
RavenNuke(tm) Development Team



Joined: Nov 07, 2003
Posts: 928

PostPosted: Wed Feb 14, 2007 8:40 am Reply with quote

Anything that helps the server is a happy thing....

Dawg
 
View user's profile Send private message
PeNdEjO
New Member
New Member



Joined: Jan 15, 2006
Posts: 1
Location: Buenos Aires

PostPosted: Fri Feb 23, 2007 1:21 pm Reply with quote

Nice, thxs Raven ^_^

_________________
BoA - ßêㆠøƒ Ãηgêl(tm) 
View user's profile Send private message Visit poster's website
fade2gray
Regular
Regular



Joined: Mar 26, 2006
Posts: 87
Location: UK

PostPosted: Thu Jun 14, 2007 5:47 pm Reply with quote

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")); Question Confused Question
 
View user's profile Send private message Visit poster's website
warren-the-ape
Worker
Worker



Joined: Nov 19, 2007
Posts: 196
Location: Netherlands

PostPosted: Wed Dec 26, 2007 6:15 am Reply with quote

^ 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?
 
View user's profile Send private message
nimis
Hangin' Around



Joined: Dec 13, 2007
Posts: 37
Location: New York, Bklyn

PostPosted: Fri Feb 29, 2008 9:12 am Reply with quote

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 Smile

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..
 
View user's profile Send private message
montego
Site Admin



Joined: Aug 29, 2004
Posts: 9457
Location: Arizona

PostPosted: Sat Mar 01, 2008 7:20 am Reply with quote

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! 
View user's profile Send private message Visit poster's website
Raven







PostPosted: Sat Mar 01, 2008 11:07 am Reply with quote

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







PostPosted: Wed Mar 05, 2008 7:42 pm Reply with quote

Got it sorted out.. thx for the help guys..
 
dad7732
RavenNuke(tm) Development Team



Joined: Mar 18, 2007
Posts: 1242

PostPosted: Sun Apr 20, 2008 8:11 am Reply with quote

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 !! Smile

Cheers, Jay
 
View user's profile Send private message
Display posts from previous:       
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Ravens PHP Scripts And Web Hosting Forum Index -> NukeSentinel(tm) v2.5.x

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©