Jump to content

Recommended Posts

Posted

Είναι συμβουλές και όχι οδηγός.

Δεν είναι copy-paste guide.

 

Με απλά λόγια σας εξηγώ τι φταίει και γενικές λύσεις. Αν δεν ξέρετε να τις εφαρμόσετε, λυπάμαι αλλά σας λείπουν αρκετές γνώσεις ακόμα και ίσως καλύτερα να αφήνατε το άνοιγμα του server σας για αργότερα. Αν έχετε ήδη server, τότε πέστε στο διάβασμα. Αυτά που εξηγώ εδώ προσωπικά τα θεωρώ must για κάποιον που θέλει να έχει server.


 

Οι server έχουν lag για τους εξής 3 λόγους:

Σύνδεση με το Internet.

Βάση δεδομένων και γενικά I/O (Input/Output, αναφερόμενο στον σκληρό δίσκο).

Java Garbage Collector (RAM και CPU Threads).

 

Η σύνδεση με το Internet:

Υποθέτω ότι σαν σοβαροί άνθρωποι έχετε κάποιον Dedicated Server ή Leased Line. Δεν θα ασχοληθώ με ADSL συνδέσεις. Εδώ δεν μπορείτε να κάνετε και πολλά, εκτός του να εξασφαλίσετε τουλάχιστον 10Mbit καλού upload/download με χαμηλό latency. Αποδεκτό μέχρι τα ~150ms.

 

Βαση δεδομένων:

Εδώ υπάρχει ένα πάρα πολύ απλό κόλπο, απλα βάλτε την Database σε χωριστό σκληρό δίσκο (όχι Partition). Θα κάνει τον server σας να πετάει. Πολλοί γνωστοί ελληνικοί server (δεν αναφέρω για να μην θίξω) κατα καιρούς μου έχουν ζητήσει βοήθεια σχετικά με Lag και Stucksub Exploits. Η λύση ήταν απλά να μεταφερθεί η Database σε χωριστό δίσκο.

Η διαδικασία είναι αρκετά απλή και συνήθως αρκεί με το να γίνει reinstall η Database σε άλλον δίσκο (αυτό για τους πιο άσχετους). Για τους σχετικούς απλά μεταφέρονται τα Files της MySQL σε άλλο δίσκο και ορίζεται το νέο path στο my.ini.

Σαν Engine προτιμώ την MyISAM (κάποιοι λένε για InnoDB αλλά εμένα με απογοήτευσε).

http://developer.spikesource.com/wiki/index.php/How_to_change_the_mysql_database_location

 

Πολύ χρήσιμο εργαλείο για όσους χρησιμοποιούν Linux ή BSD είναι το MySQL Tuner.

http://blog.mysqltuner.com/

 

Java Garbage Collector:

Εδώ είναι το πιο σημαντικό. Ο Garbage Collector εκτελείτε συχνά για να καθαρίσει την RAM από τα σκουπίδια. Με τις default ρυθμίσεις στο startGameServer.bat θα έχετε Lag ακόμα και με 30 άτομα online. Και αυτό διότι οι default ρυθμίσεις του Garbage Collector όταν εκτελείται, σταματούν τα πάντα (στην προκειμένη περίπτωση ο l2j server μας), καθαρίζει την RAM και ύστερα συνεχίζει. Δεν μπορώ να σας δώσω ακριβείς ρυθμίσεις (εμένα μου πήρε 2 χρόνια να βρώ τις τέλειες ρυθμίσεις) αλλά μπορώ να σας κατευθύνω.

 

Εξαιρετικός οδηγός:

http://www.petefreitag.com/articles/gctuning/

Αν και στα αγγλικά.

 


 

Συνοπτικά για να πάρετε μια ιδέα. Με τις παραπάνω αλλαγές κατάφερα σε έναν ταπεινό AMD X2 6000+ (Dual Core @ 3Ghz) με 8Gb RAM DDR2 800 και 2x 750Gb HDD, από 500 άτομα με λίγα lag και restart 3 φορές την εβδομάδα, να φτάσω 1100 άτομα δίχως lag με εβδομαδιαίο restart. Μιλώντας για vanilla l2j Gracia Part 2.

 

Επαναλαμβάνω, δεν σας δίνω τίποτα στο πιάτο, το γνωρίζω. Όχι από υπεροψία αλλά επειδή κάποια πράγματα τα καταλαβαίνουμε μόνο αν τα παλέψουμε και σαν συνέπεια μόνο έτσι τα αξίζουμε. Ελπίζω (στους ανοιχτόμυαλους) να τους βάλω στην διαδικασία να ψάξουν και να μάθουν, έχοντας καλά αποτελέσματα.

 

Για απορίες και εξηγήσεις είμαι εδώ (ίσως δεν τσεκάρω συχνά το θέμα αλλά σίγουρα θα απαντήσω).

Μην με ρωτάτε "έχω Χ επεξεργαστή και Χ RAM, τι ρυθμίσεις να κάνω;".

Μην μου στείλετε PM. Είμαι εδώ για να βοηθήσω όλους και δημοσίως, άρα οι ερωτήσεις σας και οι απαντήσεις μου θα είναι διαθέσιμες σε όλους.

 

Στους "γνώστες" του αντικειμένου, θα σας παρακαλούσα να μην μπείτε στην διαδικασία να σχολιάσετε τους χονδροειδείς ορισμούς μου και την απλότητά τους. Απευθύνομαι σε άτομα που δεν γνωρίζουν.

 

Αν επιτρέπεται η διαφήμιση, μπορώ να προτείνω μερικούς πολύ αξιόπιστους Dedicated Server hosts.

Posted

Se kapia pragmata mporo na sumfonisw, fusika mexri ekei pou me boithane oi gnwseis panw sto l2j.

 

Kalos o kakos oti mhxanima kai na baleis enas l2j server den tha mporesei na sikwsei panw apo 800 atoma. Isws lew kai polla.

Einai mia polu kalh idea na xwriseis ton login se diafwretiko muxanhma kai ton gameserver se allo muxanhma.

Automatos auksanoume ta atoma se 1500.

 

Good.

Posted

Οι γνώσεις σου σε προδίδουν διότι το είδα να δουλεύει με εμένα.

Επίσης λόγω το ότι ασχολούμαι πολύ καιρό με L2J είδα πολλούς admin να έχουν 1000-2000 άτομα, με μηχανήματα που δεν ήταν τόσο εξωφρενικά.

Προσωπικά πλέον δεν χρησιμοποιώ L2J πλέον, αλλά ξέρω ότι απλό θέμα απόδοσης δεν χειροτέρεψε.

 

Αν βάλεις τον Login και τον Gameserver σε χωριστά μηχανήματα, δεν κερδίζεις τίποτα απολύτως διότι ο Login δεν καταναλώνει πολλά resources. Προφανώς ήθελες να πεις να μπει η MySQL σε χωριστό μηχάνημα. Ναι έτσι αυξάνεις τους παίκτες αλλά αν έχεις 4 πυρήνες και πάνω και χωριστούς δίσκους για την MySQL όπως πρότεινα παραπάνω, είναι το ίδιο με το να τους βάλεις σε χωριστά μηχανήματα.

 

Αυτή την στιγμή ο RaidFight με restart κάθε 2-3 ημέρες (προληπτικά τόσο συχνά), με Login/Gameserver/MySQL στο ΊΔΙΟ μηχάνημα, πιάνει κάθε ημέρα τουλάχιστον 1300 άτομα online. Βέβαια δεν είναι L2J αλλά και πάλι, το μηχάνημα ούτε που ζορίζεται, με αποτέλεσμα να υπολογίζω πως σηκώνει μέχρι και 4000 παίκτες. Όσο σκατά και να είναι ο L2J (που δεν είναι δα και τόσο χάλια), το κάτω από το μισό με τίποτα...

Posted

Αυτή την στιγμή ο RaidFight με restart κάθε 2-3 ημέρες (προληπτικά τόσο συχνά), με Login/Gameserver/MySQL στο ΊΔΙΟ μηχάνημα, πιάνει κάθε ημέρα τουλάχιστον 1300 άτομα online. Βέβαια δεν είναι L2J αλλά και πάλι, το μηχάνημα ούτε που ζορίζεται, με αποτέλεσμα να υπολογίζω πως σηκώνει μέχρι και 4000 παίκτες. Όσο σκατά και να είναι ο L2J (που δεν είναι δα και τόσο χάλια), το κάτω από το μισό με τίποτα...

Ixa mpi ston RaidFight Me tin Clan "Parea Terastia"

kai Apo Sini8io Opos oli pezi na to exoume afto

Patisa

alt+b kai blepo

1800 i 1700 itane Online

kai 400 kati Offline

Afto pou nomizo o raid prepi na ine me L2J ala alo Project To Opio To xrisimopioun Kapgi server sigekrimena....

Oriste... http://www.l2dcproject.com/

Posted

Δυστυχώς όμως δεν μπορώ και δεν θέλω να κάνω σύγκριση μεταξύ L2J και L2DC.

Ο L2j είναι open source, ο L2DC είναι closed source άρα δεν έχει νόημα.

 

Ο L2DC έχει περισσότερα features, μεγαλύτερη σταθερότητα, 40% λιγότερη χρήση CPU και 25% λιγότερη χρήση RAM, και θέλει τον μισό χρόνο να κάνει load ο server. Φυσικά τα πράγματα δεν είναι τόσο ρόδινα, μόλις πριν από 2 μήνες ξεφύγαμε από τις παιδικές ασθένειες που κουβαλούσαμε από τον L2j καθώς κάναμε συνέχεια rewrite από μεγάλα κομμάτια του κώδικα ώστε να αντιμετωπίσουμε πολλά exploit και bug και σαν συνέπεια βελτιώθηκε και η απόδοση.

 

Όπως και να έχει, εδώ μιλάμε για τον L2j και όπως ανέφερα παραπάνω, στο πρώτο πόστ, με τις αλλαγές που προτείνω αυξάνεται δραστικά η απόδοση.

Posted

Nekys δυο πράγματα.

1ον έχεις καλό λέγειν και τα εξήγεις ωραία και απλά κάτι που βοηθά τους αρχάριους αλλά και τους έμπειρους χρήστες στην κατανόηση.

2ον έκανες ένα από τα καλύτερα ποστ στο Greek Section.

Μπράβο και ευχαριστώ.

Αν μπορούσες επίσης να γράψεις εδώ τι ρυθμίσεις θα έπρεπε να είχε το gameserver.bat με το hardware που πρότεινες για το συγκεκριμένο μηχάνημα , για να πάρω μια ιδέα για το Java Garbage Collector.

Posted

Δυστυχώς δεν ξέρω τι ρυθμίσεις να προτείνω, καθώς έχω παρατήσει το συγκεκριμένο Hardware εδώ και έναν χρόνο. Όπως είπα και παραπάνω όμως, δεν πρόκειται να δώσω έτοιμες λύσεις.

 

Από θέμα heal size:

-Xmx4800m -Xms4800m -Xmn1200m

Πιστεύω ότι είναι το ιδανικό.

 

Επίσης πολύ χρήσιμη προσθήκη είναι αυτό:

-XX:+PrintGCDetails -XX:+PrintGCTimeStamps

Που "τυπώνει" στο log πότε εκτελείται ο Garbage Collector και πόσο χρόνο χρειάστηκε.

 

Στον σύνδεσμο που έδωσα στο πρώτο θέμα: http://www.petefreitag.com/articles/gctuning/

Έχει λεπτομερείς οδηγίες. Προσωπικά οι περισσότεροι server lagάρουν λόγω τον μεγάλων pauses όταν εκτελείτε ο Garbage Collector. Άρα σύμφωνα με τον σύνδεσμο:

Concurrent Low Pause Collector

Collects tenured collection concurrently with the execution of the app.

The app is paused for short periods during collection

-XX:+UseConcMarkSweepGC

To enable a parallel young generation GC with the concurrent GC add -XX:+UseParNewGC to the startup. Don't add -XX:+UseParallelGC with this option.

Είναι το ιδανικό. Σου (και σας) προτείνω να διαβάσετε τον οδηγό για να καταλάβετε πρώτα τι κάνει ο Garbage Collector.

Posted

Off:File nekys na s po tin alli8ia esy m ema8es na ftiaxno server otan protoarxisa eixa dei ena guite s oxi edo pera kai arxisa ki ego kai exo na po oti eisai o kaliteros!!

On:Nc Guite!!

Posted

miso lepto guys....me grammh 2kbps kai me ths odigies tou guide sou sikonei 100 atoma? :P

tn peta3es >,<

 

Dn Boh8aei Polly.

perisoterh sumasia exei h sundesh.

Posted

Αυτό κατάλαβες ρε CorSaIr; Μισό λεπτό να σε βοηθίσω...

 

10Mbit = 1,25Mbps

 

Εσύ πως τα έβγαλες τα 2Kbps;

 

Μίλησα για minimum 10Mbit. Πουθενά δεν ανέφερα ότι 10Mbit = X άτομα.

Δεν υπάρχει τέλεια φόρμουλα για το πόση γραμμή χρειάζεσαι.

 

(ενδεικτικά) Με 1Mbit upload (128Kbps) μπορείς να σηκώσεις:

100 παίκτες που EXPάρουν ή

70 παίκτες που απλά κάνουν PvP

50 παίκτες σε Siege

40 παίκτες σε κάποιο Epic Boss

κλπ

 

Όσοι παίκτες στο γύρω περιβάλλον σου μέσα στο game, τόσο περισσότερα packets. Δηλαδή χρειάζεσαι μικρότερη γραμμή αν έχεις 100 παίκτες διάσπαρτους μέσα στον server από όταν έχεις 100 παίκτες μαζεμένους.

 

Πρότεινα μίνιμουμ 10Mbit καθώς σύμφωνα με την εμπειρία μου αρκούν για 500-600 παίκτες άρα είναι μια καλή αρχή. Με 100Mbit κανείς δεν πρέπει να έχει πρόβλημα, όσο κόσμο και να έχει, εκτός και αν αυτή η γραμμή είναι κακής ποιότητας.

 

Σε γενικές γραμμές μια γραμμή με χαμηλό latency, καλή και άμεση σύνδεση με διεθνή backbones, χωρητικότητας 10Mbit σηκώνει τους ίδιους παίκτες που μπορεί να έχει μια κακή γραμμή χωρητικότητας 30Mbit. Εκεί αποτυγχάνουν οι ADSL γραμμές και δεν σηκώνουν πάνω από 60 άτομα, διότι έχουν υψηλό latency και υπερβολικό routing σε σχέση με τα backbones εσωτερικού ή εξωτερικού.

Posted
Αυτό κατάλαβες ρε CorSaIr; Μισό λεπτό να σε βοηθίσω...

 

10Mbit = 1,25Mbps

 

Εσύ πως τα έβγαλες τα 2Kbps;

 

 

Apla se rotisa posa atoma mporei na sikosei me tetioa sindesi...se eyxaristo pollu pou mou apantises!

Posted

@nekys File mou se 8afmazo gia ola afta pou gnorizis....

ali dinoune lefta gia pc kai ola afta gia na sikosoune 300 atoma xoris lag kai eno esi me tis gnosis sou

sou ine pexnidaki!!

 

Aporia: eprepe na isouna melos tis NC i mipos ise? xDD plaka kano!

8a i8ela poli na me boi8isis kapia mera.... :)

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



  • Posts

    • I can see that the admins arent taking any action, yet they still seem willing to share information about various other people names and IP addresses. But when it comes to scams, no one reacts.      
    • Server Info Chronicle:  Interlude                                                                                                                                    XP: 100x | SP: 100x | Drop: 50x | Adena: 75x Enchant: Safe +3 |  Max +21 Website: Website Link Discord: Discord Link   WHY? When I was a teenager I had this idea. Build my own Lineage 2 server. My own rules. My own world. I wasn't a programmer. I had no idea how any of it worked. I tried, hit a wall, and quit. But the idea never left. I came back years later. Got further. Quit again. Watched friends try similar things. The idea stayed stuck in my head for fifteen years. I'm a developer now. I finally finished it. Not because I suddenly had more time - I have a full-time job and real responsibilities. An hour before bed if I'm lucky. That's actually exactly why I finished it.   The problem I kept running into I still love this game. But every server I tried as an adult made that one hour feel worthless. Log in, kill a few mobs, make no real progress, log out frustrated. The game was designed for someone with unlimited time. That person doesn't exist in my life anymore. I looked around. Everyone I used to play with has the same problem. Same love for the game. Same lack of time. Jobs, families, maybe an hour late at night. So I stopped waiting for someone else to build it.           WHAT? Custom starting zone in Gludin (up until 2nd profession start) Talent system - rebirth at level 80 and choose your talents Bounty hunter system - daily tasks to kill random monsters to receive great reward! Potion crafting system - custom HP/MP potions and recipes Custom 1st & 2nd class quests (shorter) Scheme buffer Shop until C grade   Visit our website to get more info: Website Link   The philosophy 95% of the game is completely soloable. No clan required. No raid schedules. No guilt when you have to log off. You are the solo director of your own session. Log in, pursue your goal for an hour, log out on your own terms. When you've conquered what you wanted - you stop naturally. A new season drops with fresh Talent Tree changes and you come back to build something completely different. No endless stretched grind. No pay-to-win. No shady admin decisions. No surprise wipes. I'm one developer who built this because I love it.                                          This is the server I needed fifteen years ago. Glad I finally had the skills to build it. Come see what I made. [Forever Lineage]
    • Hello MaxCheaters community! We’ve all been there: you spend months customizing your NPCs, balancing classes, and setting up the perfect farm zones. You launch your server, the hype is real, and suddenly you hit 200 players—and the "delay" starts. The mobs stop reacting, the Olympiad matches stutter, and your players start complaining on Discord. Many "newbie" admins think the solution is just throwing more RAM at the VPS. While hardware matters, Java is a finicky beast. If you don't tune your JVM (Java Virtual Machine) and your core code, you’ll lag even on a NASA supercomputer. Today, I’m sharing a deep dive into optimizing your L2 server for maximum performance. 1. The Myth of "More RAM" The biggest mistake people make is assigning 32GB of RAM to a server that only needs 8GB. In Java, if your Heap size is too large, the "Garbage Collector" (GC) has to work much harder. When the GC runs a "Full GC" cycle on a massive heap, it performs a "Stop-the-World" event. This literally freezes your server threads for 1–3 seconds to clear memory. Recommendation: For a mid-rate server with 500 players, 6GB to 8GB of Xmx (Max Heap) is usually the sweet spot. Use G1GC (Garbage First Garbage Collector) instead of the old ParallelGC. It handles large heaps much more gracefully by breaking memory into regions. 2. JVM Startup Flags (The Secret Sauce) Don't just run java -jar l2jserver.jar. You need specific flags to ensure the CPU prioritizes the right tasks. Try adding these to your start.sh or start.bat: Bash   -Xms6G -Xmx6G -XX:+UseG1GC -XX:MaxGCPauseMillis=50 -XX:+OptimizeStringConcat -XX:+UseStringDeduplication -XX:+ParallelRefProcEnabled -XX:+TieredCompilation MaxGCPauseMillis=50: This tells Java, "Try not to freeze the server for more than 50ms at a time." It makes the gameplay feel much smoother for the end-user. 3. Geodata and Pathfinding Optimization Geodata is the biggest CPU killer in Lineage 2. Every time a mob moves or a player clicks, the server calculates "Can I see this target?" and "Is there a wall in the way?". The Fix: Use a "Pathfinding Cache." If 100 players are running from the Giran Gate to the Luxury Shop, the server shouldn't calculate that path 100 times. Check your Geodata format: Ensure you are using the .l2j or .dat formats optimized for your specific core. If your console is flooded with "Pathfind node limit reached," increase your node limit in the geo.properties file, but be prepared for higher RAM usage. 4. Database Pooling (HikariCP vs. C3P0) If your server freezes for a split second every time someone saves their character or buys an item, your Database Connection Pool is the bottleneck. Most old L2J cores use C3P0, which is outdated and slow. Switch to HikariCP: It is significantly faster and handles "dead" connections much better. Also, ensure your characters and items tables are indexed correctly in MySQL. Running a VACUUM or OPTIMIZE TABLE once a week can prevent those annoying "saving player data" spikes. 5. Network Threading In your server settings, look for "Network" or "Thread" configurations. Usually, you’ll see SelectorThreads and WorkerThreads. Selector Threads: Should be equal to the number of physical CPU cores. Worker Threads: This is where the logic happens (skills, movement). If this is too low, actions will "queue up," creating a delay even if your ping is low. 6. Community Board (BBS) Optimization On MaxCheaters, we love fancy Community Boards. However, if your Buffer or Shop script is poorly coded, it might be reloading the entire HTML from the hard drive every time a player clicks a button. The Fix: Ensure your scripts cache the HTML in the RAM. Reading from an SSD is fast, but reading from RAM is thousands of times faster. Conclusion Optimization isn't a "one-click" fix; it’s about finding the balance between your hardware and your software. Start with your JVM flags, clean up your Geodata settings, and make sure your Database isn't choking on old logs. If you found this helpful, leave a comment or a "Thank You" below! If you have specific lag issues with a certain core (aCis, L2Emu, etc.), post your server.properties and I’ll try to help you tune it.
  • Topics

×
×
  • Create New...

Important Information

This community uses essential cookies to function properly. Non-essential cookies and third-party services are used only with your consent. Read our Privacy Policy and We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue..