Server Performance

So, forgive me for being a total noob. I’m trying to get ways to maximise server performance. So far, I’ve turned all my chat resources into a single resource/script (with one file), and ive bundled every car i can together into a merged resource. So i think of this as being effective, and it seems to be so far. Thinking about things like code splitting this is the exact opposite of what you want to do so I’m not sure if this is the best way to go about it. Also thinking about is it better to have a single lua file/minimum lua files in a resource or is more better? i assume more is worse. I’d like to get some words of advice from you more experienced owners, thanks!

Have you already read this thread? It goes into some fantastic detail on making a resource less impactful.

1 Like

Yeah i had read through that, i was looking more on the side of file management apposed to code management, how to package resources in a performance-friendly manner. Don’t get me wrong thats an amazing post with fantastic information ill be sure to use when i (seldom lol) make an actual script myself rather than adapt others.

There’s no real advantage of using a certain method over another for performance gains. Although, I suggest you package individual files as much as possible in a single resource and name them appropriately.

I see a lot of resources, specifically ESX related, use client/main.lua and server/main.lua as a means to organize the resource. What they forget is when an error occurs, you don’t know which resource this file belongs to. Changing the name of main.lua to something more descriptive helps a lot.

Server files wise I also suggest a setup with two folders; server (server artifact files) and server-data (resources, server.cfg etc). This way you avoid any accidental deletion of resources on upgrading the server artifact and can reuse the server artifact files for other servers (i.e. server-data-2).

Ah thanks, i didnt think of the main.lua thing. I currently have folders for categories, so i have for example, [vehicles]/[unmarked] or like [bcso] or [lspd] etc, the more files there is does that make it slower? or is that irrelevant?

Organizing resources using categories like you mentioned, will not make the server slower. It is indeed irrelevant.

1 Like