Jump to content

Recommended Posts

Posted

Since TDU2 servers are down for updates and i cant play the game that i paid 50 euros to just play online, ill try to make time fly by posting a guide regarding how and what to code when having a goal to open a server.

 

Defining the problems:

 

There are countless of problems when you are opening a server regarding the code you use. The lack of security, optimization, base retail gameplay, custom features are some of them. A pack usually, has one or many of the previous aspects missing or incomplete. Your work as a server owner/developer is to start tackling those issues by spending your manpower equally or not in some or all of those features. The thing that most users ( even advanced ones ) in this forum are doing, is tackling the wrong problem.

 

Defining your goal:

 

When you open a server, you always have a specific setup in your mind. Will it be a retail lowrate, or a custom highrate ? Will i aim for 400 people or for 2000 ? How long do i plan to keep the server ? How fast do i want to get rewards ? What type of players do i attract and where do i advertise ? What chronicle am i going to use ? All those questions and others too, will help you define your goal. What exactly you wanna do. The goal of your server, is the one that will define what problems you will need to tackle.

 

Combining them together:

 

There is no ultime guideline on how to spend your coding time based on your goal. The main idea, is that you code , for what will bring you the greatest reward. For instance, lets say you can spend 40 hours coding, and it can either be server optimization or implementation of new features. If you code for optimization, then you may be able to get the same performance with a cheaper machine, saving some money from the server rent. But if you spend those hours coding for new features, you may attract new players to the server and have higher donations. The profit you will get by higher donations may be much bigger than the money you will cut down from server budget buy having code that can run in a cheaper machine. I hope you get the idea ;)

 

Here are some bad examples:

 

1) I see high class server owners in this forum, that are posting optimization guides for mysql when their servers have about 30 people online. When you get such a low population count, you do not care about optimization. What you should focus, is making your server interesting.

 

2) An optimized pack isnt always the best pack. Default optimization can give you up to 1000 players in a 120 euro/month machine given that you spend some time coding something that attracts the players. On the other hand, fully optimized server, without any interesting in it, will get you zero players, but just the bragging rights to call your pack more stable in a forum fight.

 

 

Personal opinion:

 

Optimize, only when its needed. The year is 2011, an i7 and a couple of GB's of ram is something very common. You will be astonished to imagine how fast an i7 is. So before you go optimize , always think if its needed. Cause you may end up wasting your time in something that wont attract players, wont save you a penny, players wont even understand its impact in a 100 players server.

 

Players judge features by their existence. But they only judge optimization, by its effects. They will complain about missing features, but they wont complain about missing optimization, if its consequences are not visible ( lag ).

 

Have a nice day :)

Posted

I agree in some parts... but is only discus and not an guide for me, no one have the time to spend at last 20 sec to read your or mine bla bla guide... they want facts.

 

 

Posted

2) An optimized pack isnt always the best pack. Default optimization can give you up to 1000 players in a 120 euro/month machine given that you spend some time coding something that attracts the players. On the other hand, fully optimized server, without any interesting in it, will get you zero players, but just the bragging rights to call your pack more stable in a forum fight.

 

Thats actually true BUT optimization is always different and always for the better its not only to get more players but its for stability too.

 

For example take memory...usually ppl have a pc with 8gigs which is more than enough for quit some time BUT the memory leaks and stuff still make the pack unstable he just dont notice it until a certain amount of player when hes at a point where he cant allow such freezes or shutdowns to happen.

 

Or lets take a cpu optimalization doesnt matter how strong cpu you have it still matters so it always necessary.

 

In my opinion optimalisations are must do things as far as any pack goes if you want to know why look into the "proud to be shit" aionemu and than look into l2j and than l2emu :)

 

PS.: There can be really big differences beetwen packs if you watch only l2j you cant see it but even aion which was like 1gb at boot for memory footprint can be so fats with proper reworks to use under 300mb(the private pack of mrpoke currently use under 200mb) :)

 

Posted

When your server starts lagging due to tenured generation getting full in one day, then that would be an indication that your server succeeded and its time to optimize ;) But if you never reach the point of lagging in a good machine, you should know that your population count is bellow the excepted one.

Posted

There is all time one thing to optimize (code speaking), and code optimized = more players with same machine, or better use of hardware ressources. Stability is essential aswell, who cares your server can go 2 weeks if it crashes alone/voluntarly by evil ppl.

 

So improving code, whatever level it is, can :

- help to have more players using same computer specs.

- give a better/smoother quality of play if you had already a good computer (and avoid, for exemple, to reboot every day but every week).

 

Personally, I think you have to code anytime you can in order to optimize. One little + one little + one little... 2mo + 3mo + 1mo ram saved... As Intrepid said, there can have huge differences between packs. I won't begin on IL differences, but just know there is a difference of 200 mo between the heaviest and the lightest (which is the lightest :D It's easy, else I won't talk about :)).

 

It's the same for any chronicle, ad basically, 200mo saved it's a lot of new players, or ram used for internal program.

 

Ofc at one moment, you optimized all.... This is only during this time you can take a break IMO.

 

----

 

Another part of optimize is about configs themselves, and about hardware/softwares. I'm not in fond of this part, so I will just let my turn. I just point the fact even the code is essential, it doesn't do all. Take a shitty hardware, and you got same result than using a crappy pack (and even worse).

 

Well, thread is about coding so :).

Posted

great reflection, I managed after little more or less 80 hours to make use of ottimizzazzione high rate pvp server to my 600 megs of ram and only 2 virtual cores, holds 50 people comfortably without any lag. so I wonder why people who have super server with 2 i7 and 8gigs of ram is not concerned about optimizing your emulator to make additions without being useless? sorry for the bad English I'm using google translator

Posted
so I wonder why people who have super server with 2 i7 and 8gigs of ram is not concerned about optimizing your emulator

Simple.

 

The time it takes to optimize your server to save 40 euro/month rent by buying a cheaper machine, during that time, you can code custom things that will attract more people and bring more donations.

 

Its all about the money at the end. Code what brings you more money :)

Posted

repeat im using very bad server , vps with 600mb ram and 2 virtual cpu optimized at max no unecessary script etcetc and server max player withiut lag is 50-55 can make pvp

 

with doble of ram can reach 100 char simply? (ps pay 10€ for this hardware and i can delete donation)

Posted

hardware i know but is connection speed the problem italy was into 200° into nation adsl speed (need d a lot a € for 10/1 down up )  and for student is  big problem pay hosting society

Posted

hardware i know but is connection speed the problem italy was into 200° into nation adsl speed (need d a lot a € for 10/1 down up )  and for student is  big problem pay hosting society

 

Well network is a problem indeed but you can get a really cheap VPS easily so...

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

    • Added the protection module to the demo.   DDoS Guard Pro v2.0 is a system protection module for PlayMMO CMS designed to reduce the load on the website during HTTP floods, bot activity, suspicious frequent requests, and attacks on individual pages or API methods. Unlike simple global limiters, DDoS Guard Pro v2.0 supports flexible rules based on routes and HTTP methods. This allows you to block the entire site in a targeted manner, rather than blocking the entire site equally. You can set up protection for specific areas of the site, such as login, registration, APIs, administration, forms, and other sensitive areas. What is the purpose of the module? DDoS Guard Pro v2.0 helps protect your site from basic L7 attacks at the HTTP request level. The module is useful when your site receives: frequent requests from a single IP address; HTTP page floods; login or registration form flooding; automatic requests from bots; URL scanning; frequent API requests; suspicious activity spikes; load on individual CMS methods or pages. The module helps to reduce the load on PHP and CMS by limiting suspicious activity before it starts to create a serious load on the site. Main features Per-route and per-method Rate Limit In the new version, protection is configured not only globally, but also according to specific rules. You can set limits separately for: GET; POST; PUT; PATCH; DELETE; ALL. This allows you to flexibly protect different parts of your website. For example: for the login page, you can set a strict limit; for registration, you can set a separate limit; for the API, you can set a limit for reading and a limit for changing data; for regular website pages, you can set a soft limit or not set a limit at all. This approach reduces the risk of accidentally blocking regular users and makes the protection more accurate. Flexible rule system The module supports setting rules in the following format: METHODS|PATTERN|LIMIT|WINDOW|BURST_LIMIT|BURST_WINDOW|BLOCK_SECONDS|IDENTITY|NAME Example of rules: POST|*login*|10|60|5|10|600|ip|login_post POST|*register*|8|60|4|10|600|ip|register_post GET|*api*|300|60|80|10|120|ip|api_get PUT,PATCH,DELETE|*api*|80|60|20|10|300|ip|api_write This allows you to specify exactly: which HTTP methods to protect; which URLs or URL patterns to consider; how many requests are allowed; over what time period; what burst limit to use;  how many seconds to block the offender;  by which ID to count the limit;  what the rule is called. Burst protection against sharp spikes  In addition to the regular request limit, the module monitors sharp spikes of activity.  This is useful when a bot makes many requests in a few seconds. In this case, the protection can be activated faster, without waiting for the overall limit per minute.  Burst protection is especially useful for: authorization pages; registration; API; search; data submission forms; administrative sections. Support for different types of requests DDoS Guard Pro v2.0 works not only with POST requests. The module can control: GET — regular pages, API requests, search; POST — forms, login, registration, data submission; PUT — updating data via API; PATCH — partial data update; DELETE — data deletion; ALL — all methods at once. This makes the module suitable not only for regular sites, but also for CMS with API, personal accounts, game panels and administrative actions. Limit storage: Redis, APCu and file fallback In the new version, the module supports several options for storing temporary data. Available modes: Redis; APCu; file fallback. The auto mode tries to use the most suitable option: Redis; APCu; file storage as a fallback. Redis or APCu are suitable for more efficient operation, while the file storage is left as a fallback option for simple hosting environments that do not have additional extensions. JSONL logging The module records protection events in JSON Lines format. Logs are saved in the following file: storage/logs/ddos_guard.jsonl This format is more convenient than a regular text log, because each event is stored as a separate JSON record. The logs can record the following information: event time; IP address; HTTP method; URL; name of the triggered rule; reason for blocking; number of requests; action status; user-agent; protection mode. The JSONL format is convenient for analysis by external tools, log agents, and monitoring systems. Prometheus metrics DDoS Guard Pro v2.0 adds an endpoint for receiving metrics in Prometheus format. Endpoint: /?ddos_guard_metrics=TOKEN The token is set in the module settings. Metrics allow you to track: the number of processed requests; the number of rule activations; the number of blocks; activity by limits; protection events; module status. This allows you to connect monitoring and configure alerts so that the administrator can see when suspicious activity starts on the site. LOG ONLY mode The module has a LOG ONLY mode. In this mode, DDoS Guard Pro does not block users, but only records events and potential triggers in the log. This mode is recommended to be used after installation, in order to first see which rules are triggered, and only then to enable the real blocking.  This helps to avoid too strict limits and random blocking of regular users.  Support for Cloudflare and proxy  The module supports working behind Cloudflare or another reverse proxy.  With proper configuration, it is possible to take into account the real IP of the user, and not the IP of the proxy server.  This is important for sites that use:  Cloudflare; nginx reverse proxy; load balancers; CDN; hosting proxy protection. Nginx-recommendations DDoS Guard Pro v2.0 contains an example nginx-config: modules/ddos_guard/nginx-ddos-guard-example.conf This allows you to use the module as an additional application layer of protection, and to move the main coarse limits to the nginx level. Recommended protection scheme: Cloudflare / nginx / firewall → DDoS Guard Pro → PlayMMO CMS This approach is more correct than trying to solve all problems only at the PHP level.
  • 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..