Possible fix to Shop Closing DC

Discussion in 'Closed' started by Flickaflick, Feb 26, 2015.

  1. Flickaflick
    Offline

    Flickaflick Donator

    Joined:
    Feb 16, 2014
    Messages:
    206
    Likes Received:
    177
    Location:
    Florida
    Country Flag:
    IGN:
    Flickaflick
    Level:
    150
    If possible to code, we can try staggering the shop closings by making them close between 20-24 hours so not all shops are closing at the same time.

    When all the shops close it causes massive dc to the point the server crashes and this has become very bad recently with the increase in our player base where all the Fm's in ch 1 are full . If this is possible this will make it so most shops aren't closing at the same time and will maybe fix the huge lag issue when shops close.
     
    Oldie and Michael like this.
  2. Graces
    Offline

    Graces Donator

    Joined:
    Nov 23, 2014
    Messages:
    584
    Likes Received:
    560
    Gender:
    Male
    Location:
    Zakum's altar
    IGN:
    Nathalie
    Level:
    69
    Guild:
    -
    The lag is not because of shops closing at the same time; the lag is because too many people going to ch1 trying to get a spot at fm and the people trying to reset their shops.
     
  3. Sila
    Offline

    Sila Donator

    Joined:
    Jun 4, 2014
    Messages:
    6,199
    Likes Received:
    5,987
    Country Flag:
    IGN:
    Silachan
    Level:
    200
    Guild:
    Oblivion
    No, the lag is actually because of the shops, not the people rushing to the FM.
     
  4. Michael
    Offline

    Michael Donator

    Joined:
    Jan 16, 2014
    Messages:
    2,714
    Likes Received:
    6,506
    Country Flag:
    IGN:
    17step
    Guild:
    Heroes
    Regardless, if the lag was due to people rushing to the FM channel 1 to scoop up a spot, they would have less motivation to do so if shop closing was staggered, since people wouldn't be guaranteed to receive a spot at a very specific time. Some people will inevitably camp out in the FM rooms before 20hr uptime just as they do for boss timers, but the rush you describe would also be drastically reduced if this were implemented.

    But that's off topic, since the lag is caused by the server attempting to save all the shops all at once at 24hr uptime when the majority of them close.
     
    Sila likes this.
  5. Oldie
    Offline

    Oldie Well-Known Member

    Joined:
    Jun 6, 2014
    Messages:
    862
    Likes Received:
    259
    Location:
    PureNoob
    Country Flag:
    IGN:
    OldRanger
    Level:
    255
    Guild:
    Noobs
    Or just make the Shops less intense.
     
  6. Oldie
    Offline

    Oldie Well-Known Member

    Joined:
    Jun 6, 2014
    Messages:
    862
    Likes Received:
    259
    Location:
    PureNoob
    Country Flag:
    IGN:
    OldRanger
    Level:
    255
    Guild:
    Noobs
    That's what Graces said, that the lag is because of the shops. Good team effort though.

    Even said that because of the large player base, we got more shops and them closing all at once causes the server lag.
     
  7. Michael
    Offline

    Michael Donator

    Joined:
    Jan 16, 2014
    Messages:
    2,714
    Likes Received:
    6,506
    Country Flag:
    IGN:
    17step
    Guild:
    Heroes
    One of us is misunderstanding Graces' post, then. What I understand she is trying to say is that it is people setting up shops and moving to the FM that causes the lag. It isn't; when a shop closes (which about a hundred are undergoing at once at 24hr uptime) a number of database processes occur, which is what lags the server. In fact, if everyone was going to the FM in the hour before 1day uptime to reset their shop, the lag wouldn't even exist. The lag is caused when the server closes all of the shops at once, not when players do things with their shops.

    So that leads me back to the point already made; it doesn't matter which it is, since this suggestion actually fixes both.
     
    Graces and Flickaflick like this.
  8. ImCanadian
    Offline

    ImCanadian Donator

    Joined:
    Nov 17, 2014
    Messages:
    1,025
    Likes Received:
    1,440
    Gender:
    Male
    Location:
    Canada
    Country Flag:
    IGN:
    ImCanadian
    Level:
    200
    Guild:
    Boobs
    this seems like a good idea :D +1
     
  9. Oldie
    Offline

    Oldie Well-Known Member

    Joined:
    Jun 6, 2014
    Messages:
    862
    Likes Received:
    259
    Location:
    PureNoob
    Country Flag:
    IGN:
    OldRanger
    Level:
    255
    Guild:
    Noobs
    Oh you're right, I apologize. When I wrote my reply, I only saw yours and Sila's replies there, cause I opened the thread much earlier and it jumped and skipped graces post.. Sorry.

    Those several database processes sounds un-needed though. Shop data (items in shops + mesos in shops) should have pre existing data stored in the database so it survives a server crash. What else is there to write afterwards? Shop states + item prices can be stored in memory since a shop does not survive a server crash? o_O

    And, perhaps the database r/w for setting that the item is no longer in inventory but shop should be processed by a buffer that can only do x max db operations per second? Also should have an accessor accompanied with a trace or command to view its remaining list of operations waiting to be processed for debug purposes. (It'll have to coordinate with player saves incase a full player save writes the data before the buffer gets to it)

    Because unless the server crashes, nothing will go wrong, and if the server does crash, worst thing that can happen is the player has more items than displayable in inventory.
    Hopefully you guys have worked out the dupe thing and blocked obtaining more items than your inventory limit so perhaps you could make any extra undisplayable items show up in frederick anyways.

    Character logon script:

    for i In DBRead(this.Character, Items) ; i is less than (limit * 2) + 2 {
    IF( i > limit && DBRead(this.Character, Items) != null)
    {
    IF( i == (limit *2) + 1 ) { logger.HackingAttempt(this.Character, Too_Many_Items); return;}
    //Code to append the items to frederick's item list in server memory, stored until removed or a shutdown.
    }
    IF( DBRead(this.Character, Items) == null ){ //Confirm to append these items, create the storage location and store in server memory }

    // The upper Comment code location should create a temporary array to hold these items, then once the second IF statement doesn't determine that there was a hacking attempt, the third IF statement goes ahead to display those extra items in frederick.


    Hope this was helpful! It was fun to write.
     

Share This Page