1. Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the comminuty!

    Now, what are you waiting for? Join the community now!

  2. LOOKING FOR A VERSION OF SKRIPT?

    You can always check out our Wiki for downloads and any other information about Skript!

Dismiss Notice
This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

what should I do ? Variable files are large, causing the server to lag

Discussion in 'Skript' started by jomjonejame, May 8, 2017.

Thread Status:
Not open for further replies.
  1. jomjonejame

    jomjonejame Member

    Joined:
    Jan 26, 2017
    Messages:
    54
    Likes Received:
    1
    "variables.csv" size is 28,673 KB

    [​IMG]

    Server lag every 5 minute. I'm try remove variables file to 2,000 KB Fixed this problem
    There is a solution to this problem. Besides deleting files?
     
  2. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,184
    Likes Received:
    231
    Remove unuseful variables from your skript
     
    • Like Like x 1
  3. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,184
    Likes Received:
    231
    Thank for answer and If all the variables are important. Is there another way?

    or add variables to SQL database and remove all variables from variables file. You think Is it good ?
     
  4. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,184
    Likes Received:
    231
    You can add to Database and clear that unuseful variable
     
  5. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,184
    Likes Received:
    231
    20 MB shouldn't be a that big probem.
    Try splitting that one database in different databases, and you should try SQLite.

    [​IMG]
    10 SQLite Databases, 240+ MB without Problems [Biggest database is 140+ MB]
     
    • Like Like x 1
  6. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,184
    Likes Received:
    231
    Want a sample to add variables to SQLite
     
  7. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,184
    Likes Received:
    231

    Code (Skript):
    1. Database1:
    2.         type: SQLite
    3.      
    4.         pattern: Variable pattern (regex)
    5.         file: ./plugins/skript/Database1.db
    6.         backup interval: 0 hours# 0 = don't create backups
    7.         monitor changes: false
    8.         monitor interval: 120 seconds
     
  8. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,184
    Likes Received:
    231
    i saw the files created in year 2560..
     
  9. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,184
    Likes Received:
    231
    If your server is still lagging, try using YML to store some variables. You'll need SkUtilities.

    I use YML for most of my individual player variables.
    {%player%.autopickup} -> yml value "%UUID of player%.prefs.autopickup" of file "{@SaveFile}"
     
  10. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,184
    Likes Received:
    231
    No, because https://forums.skunity.com/threads/dont-use-yaml.3850/
     
    • Agree Agree x 3
  11. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,184
    Likes Received:
    231
    I got 39 plugins, 100mb of variables in a 2gb ram server and TPS is 19.99 at 99% of the time...
     
  12. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,184
    Likes Received:
    231
    • Agree Agree x 1
  13. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,184
    Likes Received:
    231
    Host is VPS Server - 64 Plugin Ram 10GB
    --- Double Post Merged, Jun 26, 2017, Original Post Date: Jun 26, 2017 ---
    Or because of writing the system causing the server to lag.
    --- Double Post Merged, Jun 26, 2017 ---
    Thank you, I'm try use MYSQL database, May be better
     
  14. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,184
    Likes Received:
    231
    The server doesn't write to the variables file until the server is shutting down, so no.
     
  15. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,184
    Likes Received:
    231
    This is wrong. The server writes variables to file as soon as the variable value changes/is set.
     
    • Informative Informative x 1
  16. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,184
    Likes Received:
    231
    What was it that doesn't get done till shutdown then? maybe it was deletion of variables from the file?
     
  17. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,184
    Likes Received:
    231
    It says in the config that variables are deleted when the server shuts down. But that is wrong as well. The variable file is cleaned when the server is started.
     
Thread Status:
Not open for further replies.

Share This Page

Loading...