Thread Rating:
  • 2 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
2019-11-15 Server Load
#1
Server Load
Server load has grown steadily worse for days, maybe weeks.

Some investigating took me to a small city that was taking almost five minutes to prepare its city report. The mystery grew deeper when the lag was caused by consolidating the inventories of the various buildings in the city into one inventory for the city report. How could that take minutes?

Digging deeper showed that some of the buildings were storing lists of nearly 100,000 different items. That is different items, not counts. Counts of items are just numbers on the items. Differences arise from items that cannot be stacked with other items.

The problem was hidden by the way the inventory is sorted for the city report. The sorting process expected the list items to have unique names. They didn't. I fixed the city report but that fix will not appear until the next client update, not needed for this server fix.

An error was found in an operator== override for old style DNA. The error was introduced recently when a pure base class was implemented for handling old and new DNA uniformly.

The solution fixes inventory lists as they are loaded. You don't have to do anything.

Then we'll find the next most greedy bit of code, eating up CPU time needlessly.

Aspiring programmers should always remember; make it part of your DNA. No CPU instruction is free.

Obsolete Items
Old style cities used to throw away obsolete items. New style cities never throw away obsolete items. This results in long lists of items with slightly different qualities.

New style cities now discard obsolete items when the city report is created. This should further reduce those big lists of inventory items in cities.

Buildings individually maintain their own inventories and residents. Buildings individually decide which of their inventory items are obsolete. The city accumulates all items from all buildings, so the city report may show items that would be considered obsolete if all of the items were considered together.

What makes an item obsolete?
  • Air and Water are never obsolete in a harsh environment.
  • Food is never obsolete if it is edible to the residents of the building.
  • Upgrade Modules are obsolete if the inventory contains more of them at a higher Q.
  • Other items are obsolete if the inventory is more than half filled with items at least 2 Q's higher than the item. In other words, if the number of items that are itemQ+2 or higher equals or exceed half the storage available, the item is obsolete.
Reply
#2
Good find. Is there a way to set a warehouse to gather only specific quality items? If I have multiple resource streams (or rather when I have multiple resource streams) I would like to be able keep them, in separate warehouses if necessary to preserve them.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)