PHP Web Host - Quality Web Hosting For All PHP Applications $35/month $250/year (Unlimited) - $25/month - 200,000 impressions - Your Ad Could be Here - Click For Details
  Login or Register
 • Home • Downloads • Your Account • Forums • 

View next topic
View previous topic


Google
 
Web RavenPHPScripts (This Site)
Post new topic   Reply to topic
Author Message
Raven
Site Admin/Owner


Joined: Aug 27, 2002
Posts: 15209
Location: Kansas

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

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 Visit poster's website AIM Address Yahoo Messenger
Gremmie
Former Moderator in Good Standing


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

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

If you run without any IP2Country data ($bypassNukeSentinelInvalidIPCheck = true), will this have any effect on performance?
View user's profile Send private message
Raven
Site Admin/Owner


Joined: Aug 27, 2002
Posts: 15209
Location: Kansas

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

None at all.
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger
Dawg
Life Cycles Becoming CPU Cycles


Joined: Nov 07, 2003
Posts: 555

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

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 Back to top

Nice, thxs Raven ^_^
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 Back to top

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: 177
Location: Netherlands

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

^ 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 Back to top

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: 7452
Location: Arizona

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

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.
View user's profile Send private message Visit poster's website
Raven
Site Admin/Owner


Joined: Aug 27, 2002
Posts: 15209
Location: Kansas

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

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.
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger
nimis
Hangin' Around


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

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

Got it sorted out.. thx for the help guys..
View user's profile Send private message
dad7732
Worker
Worker


Joined: Mar 18, 2007
Posts: 224

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

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:       
Post new topic   Reply to topic

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
Forums ©
 

All logos and trademarks in this site are property of their respective owner.
The comments are property of their posters, all the rest © 2002-2008 by Raven
Proud to be listed at Lobo Links Web Directory

You can syndicate our news using the file xml

CSE HTML Validator Helped Clean up This Page! [Valid RSS] valid RSS 2.0 Valid robots.txt Stop Spam Harvesters, Join Project Honey Pot

Website engines core code is © copyright by PHP-Nuke but has been heavily patched and modified by myself and others.
PHP-Nuke is a free software released under the GNU/GPL.


:: fisubice phpbb2 style by Daz :: PHP-Nuke theme by www.nukemods.com ::

:: fisubice Theme Recoded To 100% W3C CSS & HTML 4.01 Transitional Compliance by Raven and 64bitguy ::

:: W3C CSS Compliance Validation :: W3C HTML 4.01 Transitional Compliance Validation ::

zerosum