Previous Thread
Next Thread
Print Thread
Rate Thread
Joined: Sep 2001
Posts: 194
svr
Offline
Member
Member
Offline
Joined: Sep 2001
Posts: 194
Hi guys on 5.47e, there is a default link "view today's active topics" which uses "search.cgi?action=getdaily"

I know how cpu intensive search script is and I have search disabled.

However the command above is useful and so I still have the link on display. But this badly written script (or so I think) chews up 80-85% of cpu time at the time it runs (for however many milliseconds)!!

Is there any way in Linux I can create a special file "search.cgi" in the ubb bin directory which actually calls out "nice -n 19 REALsearchscript.cgi" so that by default whenever search.cgi is run, it runs with nice -n 19 ???

In Linux as far as I know I can nice an entire account that runs all the scripts but I just want this one script to be niced.

Or is there any other way to decrease cpu usage of this script when used with active topics daily? Thx in adv!

Sponsored Links
Joined: Dec 2000
Posts: 730
deutscher moderator / v5 specialist
deutscher moderator / v5 specialist
Offline
Joined: Dec 2000
Posts: 730
hi svr,

i modified the script. it is now faster (only with many postings). i'm not ready yet...

i post it when i'm ready. i think onwendsday i have time to finish the mod.

Joined: Dec 2000
Posts: 730
deutscher moderator / v5 specialist
deutscher moderator / v5 specialist
Offline
Joined: Dec 2000
Posts: 730
the first version of speedup the "daily topic display" is ready.

you can download the mod here

Joined: Sep 2001
Posts: 194
svr
Offline
Member
Member
Offline
Joined: Sep 2001
Posts: 194
Thanks, interesting, I'll def. hack it and get back to you soon!!

Just briefly could you tell us all what changes are you making?

Joined: Dec 2000
Posts: 730
deutscher moderator / v5 specialist
deutscher moderator / v5 specialist
Offline
Joined: Dec 2000
Posts: 730
i read the daily topic direct in a hash and copy the data to an array to display them.
now you dont need a check for double entries. this saves time.

i test it with 150 entries.
time with old getdaily: 150 ms (average)
time with new getdaily: 90 ms (average)

Sponsored Links
Joined: Sep 2001
Posts: 194
svr
Offline
Member
Member
Offline
Joined: Sep 2001
Posts: 194
Hmm I just hacked it you seem to be missing a } bracket somewhere in this hack above coz it complains about unclosed curly bracket with perl -c.

Joined: Sep 2001
Posts: 194
svr
Offline
Member
Member
Offline
Joined: Sep 2001
Posts: 194
If I understand you correctly you want all the code between

if (-e "$NonCGIPath/dailyindex-$LastLoginJulianDATE.file") {

AND

print<
to be replaced by the hacked code right?

In other words the two lines above do not need to be replaced right?

Joined: Dec 2000
Posts: 730
deutscher moderator / v5 specialist
deutscher moderator / v5 specialist
Offline
Joined: Dec 2000
Posts: 730
yes...

remove the line
Code
[/code]
the second line
[code]
do not need to be replaced

Joined: Sep 2001
Posts: 194
svr
Offline
Member
Member
Offline
Joined: Sep 2001
Posts: 194
Hi there it works that is, it definitely reduces cpu usage. BUT it also shows multiple topics (same topics that were active) so my list of active topics actually goes up 3x because it is showing duplicate (or more) topics in the same list. I think you may have to add the duplicate topic code check back in?

Joined: Dec 2000
Posts: 730
deutscher moderator / v5 specialist
deutscher moderator / v5 specialist
Offline
Joined: Dec 2000
Posts: 730
can you post a line from the daily index?

Sponsored Links
Joined: Sep 2001
Posts: 194
svr
Offline
Member
Member
Offline
Joined: Sep 2001
Posts: 194
Sure here it is:

5|006019|nina01|01-15-2002|im back|Nina

Joined: Sep 2001
Posts: 194
svr
Offline
Member
Member
Offline
Joined: Sep 2001
Posts: 194
Hi jokingdown do let me know when you find the time to patch it. thx.

Joined: Dec 2000
Posts: 730
deutscher moderator / v5 specialist
deutscher moderator / v5 specialist
Offline
Joined: Dec 2000
Posts: 730
i look at it tomorrow. today i was on a very long meeting...

Joined: Sep 2001
Posts: 194
svr
Offline
Member
Member
Offline
Joined: Sep 2001
Posts: 194
Hey joking'down I am waiting for the hack/mod thx!

Joined: Dec 2000
Posts: 730
deutscher moderator / v5 specialist
deutscher moderator / v5 specialist
Offline
Joined: Dec 2000
Posts: 730
i found the error

search
Code
[/code]
and replace with
[code]

$tempData[2] contain the authors name...

Joined: Sep 2001
Posts: 194
svr
Offline
Member
Member
Offline
Joined: Sep 2001
Posts: 194
You sir, are a coder par excellence smile


Link Copied to Clipboard
Donate Today!
Donate via PayPal

Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.

Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.
Recommended Hosts
We have personally worked with and recommend the following Web Hosts:
Stable Host
bluehost
InterServer
Visit us on Facebook
Member Spotlight
Bill B
Bill B
Issaquah, WA
Posts: 87
Joined: December 2001
Forum Statistics
Forums63
Topics37,575
Posts293,931
Members13,824
Most Online6,139
Sep 21st, 2024
Today's Statistics
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
Top Posters
AllenAyres 21,079
JoshPet 10,369
LK 7,394
Lord Dexter 6,708
Gizmo 5,834
Greg Hard 4,625
Top Posters(30 Days)
Gizmo 1
Top Likes Received
isaac 82
Gizmo 20
Brett 7
WebGuy 2
Morgan 2
Top Likes Received (30 Days)
None yet
The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2025 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 8.0.1
(Snapshot build 20240918)