View unanswered posts | View active topics It is currently Thu Mar 28, 2024 11:52 pm



Reply to topic  [ 17 posts ]  Go to page 1, 2  Next
 Planet list slowdown 
Author Message
Site Admin
User avatar

Joined: Sun Dec 24, 2000 3:00 am
Posts: 3150
Location: USA
Unread post Planet list slowdown
Ok, I'm looking at the issue of long planet lists bogging down a server. I know we got into questions of whether we should allow that many planets, or whether the planet "touch" function is as efficient as it could be, but I think the real issue here is something that's actually been dealt with in other places and just overlooked here because long planet lists are less common.

Generally, whenever there's the possibility of a long display, especially when there's overhead associated with generating that display (like the known universe display, or many CIM displays), the game does some pacing to avoid one session hogging too much CPU. So that's what needs to be done here, and while I'm at it, I would like to consider if there are any other long, high-overhead displays that need to be paced.

I'm curious if there are objections to putting planet lists on the list of "screen pause" displays. These are displays that are automatically given a "more" prompt whenever they go longer than a single screen. Screen pause is a user setting, and it seems like someone who wants screen pauses would like to have long planet lists (or any long sector display lists) pause between screens. Any thoughts?

That isn't really the solution to this problem, but just something I noticed while looking at this problem. It seems like any long list like this where a player might actually be reading the list, it's good to have the option for a screen pause. But to actually solve this problem, I need to put in either a per-line delay or a per-screen delay just to make sure the game gives up the CPU for other apps. I should be able to do that in a way that won't be too noticeable. Let's give it a try and see if there are any issues with it.

_________________
John Pritchett
EIS
---
Help fund the TradeWars websites! If you open a hosting account with A2 Hosting, the service EIS uses for all of its sites, EIS will earn credits toward its hosting bill.


Fri Jun 04, 2010 12:29 am
Profile WWW
Ambassador
User avatar

Joined: Mon Feb 09, 2004 3:00 am
Posts: 3141
Location: Kansas
Unread post Re: Planet list slowdown
In the problem I brought up about the large numbers of planets, we abort the displays anyway and still kill the server.

_________________
               / Promethius / Enigma / Wolfen /

"A man who has no skills can be taught, a man who has no honor has nothing."


Fri Jun 04, 2010 12:35 am
Profile ICQ
Veteran Op
User avatar

Joined: Thu Jun 02, 2005 2:00 am
Posts: 5558
Location: USA
Unread post Re: Planet list slowdown
Yup. Abort the list, CPU still bogs.

This happens w/ resource movers, too, even on a smaller (aborted) list.

_________________
May the unholy fires of corbomite ignite deep within the depths of your soul...

1. TWGS server @ twgs.navhaz.com
2. The NavHaz Junction - Tradewars 2002 Scripts, Resources and Downloads
3. Open IRC chat @ irc.freenode.net:6667 #twchan
4. Parrothead wrote: Jesus wouldn't Subspace Crawl.

*** SG memorial donations via paypal to: dpocky68@booinc.com
Image


Fri Jun 04, 2010 12:39 am
Profile ICQ WWW
Site Admin
User avatar

Joined: Sun Dec 24, 2000 3:00 am
Posts: 3150
Location: USA
Unread post Re: Planet list slowdown
That's because aborting the display only aborts the output, not the processing. That could be changed, but I'm under the impression that part of the problem is with people abusing the long planet lists specifically to bog down the server. Either way, I think it's best to put some pacing on this or any open-ended command like this. There just need to be limits on this kind of processing. There will be some slowdown, so I need feedback to make sure it doesn't slow things down too much. I just need to get the right balance.

_________________
John Pritchett
EIS
---
Help fund the TradeWars websites! If you open a hosting account with A2 Hosting, the service EIS uses for all of its sites, EIS will earn credits toward its hosting bill.


Fri Jun 04, 2010 3:46 am
Profile WWW
Ambassador
User avatar

Joined: Fri Feb 23, 2001 3:00 am
Posts: 4016
Location: USA
Unread post Re: Planet list slowdown
Is it possible to have the planet list pause as a toggle under player preferences?

C, N,...

_________________

BOTE 1998 Champs: Team Fament
HHT 2015 Champs: Cloud09
Big Game 2016 Champs: Draft team
HHT 2018 Champs: Rock Stars
Big Game 2019 Champs: Draft Team


Classic Style Games Here:
telnet://crunchers-twgs.com:2002

Web page from 1990's: https://web.archive.org/web/20170103155645/http://tradewars.fament.com/Cruncher/tradewar.htm
Blog with current server info: http://cruncherstw.blogspot.com
Discord: https://discord.gg/4dja5Z8
E-mail: Cruncherstw@gmail.com
FaceBook: http://www.facebook.com/CrunchersTW


Fri Jun 04, 2010 10:31 am
Profile ICQ WWW
Site Admin
User avatar

Joined: Sun Dec 24, 2000 3:00 am
Posts: 3150
Location: USA
Unread post Re: Planet list slowdown
I was asking for people's thoughts on that above. I'd like to add the planet scanner list and also sector display to the "screen pause" option under personal settings. These lists can both get pretty long and I think it makes sense to have them pause on screen like other long displays.

Are there any other long lists that were missed when I added the screen pause option?

_________________
John Pritchett
EIS
---
Help fund the TradeWars websites! If you open a hosting account with A2 Hosting, the service EIS uses for all of its sites, EIS will earn credits toward its hosting bill.


Fri Jun 04, 2010 12:27 pm
Profile WWW
Site Admin
User avatar

Joined: Sun Dec 24, 2000 3:00 am
Posts: 3150
Location: USA
Unread post Re: Planet list slowdown
Ok, I went through the displays and added configurable page breaks to these displays that did not use them:

sector display
planet scanner display
corporate list
corporate ranks
corp assets list
deployed fighter scan
deployed mine scan

This is configured as Computer/Personal Settings/Screen Pauses. Scripters generally keep these off, so this is for the manual player. Just a little cleanup here. If there are any objections, let me know.

_________________
John Pritchett
EIS
---
Help fund the TradeWars websites! If you open a hosting account with A2 Hosting, the service EIS uses for all of its sites, EIS will earn credits toward its hosting bill.


Fri Jun 04, 2010 2:08 pm
Profile WWW
Lieutenant J.G.

Joined: Fri Jan 16, 2009 4:44 pm
Posts: 494
Unread post Re: Planet list slowdown
does the long ship list do the same bogging down as a long planet list?


Fri Jun 04, 2010 2:10 pm
Profile
Site Admin
User avatar

Joined: Sun Dec 24, 2000 3:00 am
Posts: 3150
Location: USA
Unread post Re: Planet list slowdown
It shouldn't, because it's not locking the data files in order to update records. That's where the overhead comes in. Planet and port updates require multiple file locks, and when you cycle through many of them, especially when more than one person is hitting the same list, it can get pretty messy.

_________________
John Pritchett
EIS
---
Help fund the TradeWars websites! If you open a hosting account with A2 Hosting, the service EIS uses for all of its sites, EIS will earn credits toward its hosting bill.


Fri Jun 04, 2010 2:15 pm
Profile WWW
Veteran Op
User avatar

Joined: Thu Jun 02, 2005 2:00 am
Posts: 5558
Location: USA
Unread post Re: Planet list slowdown
John Pritchett wrote:
I was asking for people's thoughts on that above. I'd like to add the planet scanner list and also sector display to the "screen pause" option under personal settings. These lists can both get pretty long and I think it makes sense to have them pause on screen like other long displays. Are there any other long lists that were missed when I added the screen pause option?


If people are aborting the display, it won't show the screen pause (or at least it shouldn't). But
that means the road to abuse is still there, since people generally do not display large lists.

Likewise, the problem still happens on small lists if you use a macro resource mover. If you add
a small amount of pacing, be careful. Pgridding would be very affected by that, so make sure
it's small. If there's any other way...

And the ship list DOES cause a lag. Get 100 ships, xport back and forth between them. You'll
see a big spike in CPU usage.

_________________
May the unholy fires of corbomite ignite deep within the depths of your soul...

1. TWGS server @ twgs.navhaz.com
2. The NavHaz Junction - Tradewars 2002 Scripts, Resources and Downloads
3. Open IRC chat @ irc.freenode.net:6667 #twchan
4. Parrothead wrote: Jesus wouldn't Subspace Crawl.

*** SG memorial donations via paypal to: dpocky68@booinc.com
Image


Fri Jun 04, 2010 4:24 pm
Profile ICQ WWW
Site Admin
User avatar

Joined: Sun Dec 24, 2000 3:00 am
Posts: 3150
Location: USA
Unread post Re: Planet list slowdown
Ah, didn't catch that at first, but ship display is running a warp route for each ship, so yeah, there is a significant amount of overhead there. Good catch.

I'd say that planet update, port update, and warp path scanning are the heaviest load in the game. Any operation that has the potential to run many of these operations without any pacing is a bad thing, because one user session can grab all of the CPU for however long it takes to complete that operation. What I'd like to do is put in a "release CPU" operation on these commands. That allows the OS to be more smart about balancing the load. If nobody else is on, the operations will run very quickly. If others are on, though, it will slow things down, but in a balanced way. Better to slow everyone down a little than to freeze some while others get 100% CPU.

_________________
John Pritchett
EIS
---
Help fund the TradeWars websites! If you open a hosting account with A2 Hosting, the service EIS uses for all of its sites, EIS will earn credits toward its hosting bill.


Fri Jun 04, 2010 4:51 pm
Profile WWW
Veteran Op
User avatar

Joined: Thu Jun 02, 2005 2:00 am
Posts: 5558
Location: USA
Unread post Re: Planet list slowdown
John Pritchett wrote:
I'd say that planet update, port update, and warp path scanning are the heaviest load in the game. Any operation that has the potential to run many of these operations without any pacing is a bad thing, because one user session can grab all of the CPU for however long it takes to complete that operation. What I'd like to do is put in a "release CPU" operation on these commands. That allows the OS to be more smart about balancing the load. If nobody else is on, the operations will run very quickly. If others are on, though, it will slow things down, but in a balanced way. Better to slow everyone down a little than to freeze some while others get 100% CPU.


As long as it's not a fixed mandatory delay, there's no problem. It basically means that
landing will be delayed by an OS cycle, and that's not enough to worry about in most
cases. It also means that a smart player can use these commands to time the load of
the server, and grid when it's the least. Frankly, I kind of like that...

If you do add a fixed delay, keep it less than 10ms, preferably 5ms or less. Otherwise
it shifts the balance outta wack.

_________________
May the unholy fires of corbomite ignite deep within the depths of your soul...

1. TWGS server @ twgs.navhaz.com
2. The NavHaz Junction - Tradewars 2002 Scripts, Resources and Downloads
3. Open IRC chat @ irc.freenode.net:6667 #twchan
4. Parrothead wrote: Jesus wouldn't Subspace Crawl.

*** SG memorial donations via paypal to: dpocky68@booinc.com
Image


Fri Jun 04, 2010 7:32 pm
Profile ICQ WWW
Site Admin
User avatar

Joined: Sun Dec 24, 2000 3:00 am
Posts: 3150
Location: USA
Unread post Re: Planet list slowdown
Unfortunately, I don't have that kind of fine control over delays. Anything less than 20 ms is beyond the resolution of the clock. At least I can't rely on getting better than that. Using 0 delay means that I'll get back as soon as possible after releasing the time slice to another equal-priority app.

"A value of zero causes the thread to relinquish the remainder of its time slice to any other thread of equal priority that is ready to run. If there are no other threads of equal priority ready to run, the function returns immediately, and the thread continues execution."

so that's really the best I can do here.

_________________
John Pritchett
EIS
---
Help fund the TradeWars websites! If you open a hosting account with A2 Hosting, the service EIS uses for all of its sites, EIS will earn credits toward its hosting bill.


Fri Jun 04, 2010 8:19 pm
Profile WWW
Veteran Op
User avatar

Joined: Thu Jun 02, 2005 2:00 am
Posts: 5558
Location: USA
Unread post Re: Planet list slowdown
John Pritchett wrote:
so that's really the best I can do here.


I think that will work beautifully.

_________________
May the unholy fires of corbomite ignite deep within the depths of your soul...

1. TWGS server @ twgs.navhaz.com
2. The NavHaz Junction - Tradewars 2002 Scripts, Resources and Downloads
3. Open IRC chat @ irc.freenode.net:6667 #twchan
4. Parrothead wrote: Jesus wouldn't Subspace Crawl.

*** SG memorial donations via paypal to: dpocky68@booinc.com
Image


Fri Jun 04, 2010 8:24 pm
Profile ICQ WWW
Site Admin
User avatar

Joined: Sun Dec 24, 2000 3:00 am
Posts: 3150
Location: USA
Unread post Re: Planet list slowdown
Well, we'll definitely see. Let's get it up there and you guys can give it a pounding and make sure it doesn't slow your pace too much.

_________________
John Pritchett
EIS
---
Help fund the TradeWars websites! If you open a hosting account with A2 Hosting, the service EIS uses for all of its sites, EIS will earn credits toward its hosting bill.


Fri Jun 04, 2010 8:30 pm
Profile WWW
Display posts from previous:  Sort by  
Reply to topic   [ 17 posts ]  Go to page 1, 2  Next

Who is online

Users browsing this forum: No registered users and 23 guests


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 post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by STSoftware.