Server lagging issue

  • As I don’t know where to post this, i’ll do it here, excuse me if i’m wrong.

Hello there devs! I’m currently developing a City game, but we’re experiencing some issues.

Issue


So when we play the game, everything seems to work fine and the clients fps are higher than 40. But it seems that the Server is lagging.

Examples:


Wait(0.1) is taking about 2 seconds to run

 Door1.CFrame = Door1.CFrame * CFrame.new(0,0.1,0)
	wait(0.1)

robloxapp-20210613-2144144.wmv (2.2 MB)

As you see, my client is running pretty well, but when I click on the button it takes a lot of time to open (when it should be quickly)

Example 2:

Doors opening slowly.

robloxapp-20210613-2147053.wmv (349.1 KB)

As you see, they’re taking a lot of time to open, and inside the script they should take about 2 seconds.

Notes:


My game’s map is kinda big, so there are many parts inside it.

Solutions i’ve tried:


I’ve enabled StreamingEnabled property in workspace and it seems to fix it a little bit but it doesn’t work.

Already posted one topic about this but I couldn’t really solve it.

I searched on youtube how to solve this and I couldn’t find anything.

I removed welds and make sure everything is anchored, but still a bit.

  • So I don’t know if it can be a script or something.

But any help is appreciated :smiley: Thanks! :smiley:

** If you need more information ask me!**

1 Like

Have you tried taking the wait out?
Is the script client or server based?

1 Like

StreamingEnabled won’t help speed up the server, only the client. Since the server still holds all the parts information but just sends less to the client.

1 Like

If I remove the waits on the scripts, it would just give me a timeout exhausted error.

Oh! I didn’t knew about it, I’m trying to review the whole scripts and see if any of those scripts are making trouble

Wait is unreliable, use RunService.Heartbeat instead.

Just be careful as there are still reports of unions getting corrupted…

Also meshes are more performant than unions.

2 Likes

Thank you! I’ve just done some of these solutions and it seems to be better! Thanks for your examples and explanation! :smiley:

and thanks all of you for taking the time to read my problem!

1 Like