My game is now laggy after Roblox incident

After today’s Roblox incident, and I think before that as well, my game has been dropping in performance very fast, some players have reported that their FPS is dropping from 240 to 15 FPS, I asked them to send me a picture of their Micro Profiler, and it is very saturated. Additionally, the leaderboards among others are not loading correctly in the game, and besides that the console keeps repeating an error that says “Player:IsInGroup error: Player not in datamodel”.

Console:

Micro Profiler:

It seems to me that you have a script thats using an “old” player variable since the player left the game. My guess is you have some sort of loop connected to a playerAdded function referencing the player when he first joined → the loop is continuing to run even when the player left → so when it tries to update the players “PlayTime” it results in the above error.

As for the datastore warning, you’re sending to many request. This shouldn’t cause any performance issues but some data might fail to save due to roblox rate limits.

Aside from that are you sure you don’t have any other memory leaks? Are you disconnecting connections when not needed, etc?

2 Likes

Agreed with the above post: this seems more like inherent issues with your code making broad existence assumptions that are now being properly revealed rather than being related to the outage. Service outages are more likely to result in endpoints returning non-successful HTTP codes rather than standard code exceptions.

Please try to debug and supply us with information about your current implementations relating to the errors in your console before chalking up this problem’s cause being the outage.

2 Likes

Here’s the code in case you need it, @colbert2677 @Ze_tsu

-- SERVICES
local MarketplaceService = game:GetService("MarketplaceService")
-- VARIABLES
local GroupId: number = 13519293
local VIPGamePassId: number = 26793001
-- MODULE
local UtilsFunctions: Typedef do
	UtilsFunctions = {
		FormatPlaytime = function(playtime: number, mode: string): string
			if mode == "round" then
				local PlaytimeMinutes: number = (playtime - playtime % 60) / 60
				playtime = playtime - PlaytimeMinutes * 60
				local PlaytimeHours: number = (PlaytimeMinutes - PlaytimeMinutes % 60) / 60
				PlaytimeMinutes = PlaytimeMinutes - PlaytimeHours * 60

				local FormatSeconds: string = string.format("%02i", playtime)
				local FormatMinutes: string = string.format("%02i", PlaytimeMinutes)
				local FormatHours: string = string.format("%02i", PlaytimeHours)

				if FormatHours == "00" then
					if FormatMinutes == "00" then
						return FormatSeconds
					else
						return FormatMinutes .. ":" .. FormatSeconds
					end
				else
					return FormatHours .. ":" .. FormatMinutes .. ":" .. FormatSeconds
				end
			elseif mode == "complete" then
				local PlaytimeMinutes: number = (playtime - playtime % 60) / 60
				playtime = playtime - PlaytimeMinutes * 60
				local PlaytimeHours: number = (PlaytimeMinutes - PlaytimeMinutes % 60) / 60
				PlaytimeMinutes = PlaytimeMinutes - PlaytimeHours * 60

				local FormatSeconds: string = string.format("%02i", playtime)
				local FormatMinutes: string = string.format("%02i", PlaytimeMinutes)
				local FormatHours: string = string.format("%02i", PlaytimeHours)
				
				return FormatHours .. ":" .. FormatMinutes .. ":" .. FormatSeconds
			end
			return "XX:XX:XX"
		end,
		GetPlaytimeLevel = function(playtime: number, player: Player?): number
			if player and player:IsA("Player") then
				local success: boolean, playerOwnsVIP: boolean = pcall(function()
					return MarketplaceService:UserOwnsGamePassAsync(player.UserId, VIPGamePassId)
				end)
				
				local ResultLevel: number = 0
				local SecondsCycle: number = 180
				
				if playerOwnsVIP then
					SecondsCycle = 120
				elseif player:IsInGroup(GroupId) then
					SecondsCycle = 150
				end
				
				for level = 1, math.huge, 1 do
					local LevelPlaytime: number = SecondsCycle * level
					if LevelPlaytime > playtime then
						ResultLevel = level
						break
					end
				end
				
				return ResultLevel
			else
				local ResultLevel: number = 0
				local SecondsCycle: number = 90
				
				for level = 1, math.huge, 1 do
					local LevelPlaytime: number = SecondsCycle * level
					if LevelPlaytime > playtime then
						ResultLevel = level
						break
					end
				end
				
				return ResultLevel
			end
		end,
		CreatePlayerLeaderstats = function(player: Player, playtime: number): ()
			local LeaderstatsFolder: Folder = Instance.new("Folder", player)
			LeaderstatsFolder.Name = "leaderstats"
			
			local OriginalValuesFolder: Folder = Instance.new("Folder", LeaderstatsFolder)
			OriginalValuesFolder.Name = "OriginalValues"
			
			local LevelValue: NumberValue = Instance.new("NumberValue", LeaderstatsFolder)
			LevelValue.Name = "Level"
			LevelValue.Value = UtilsFunctions.GetPlaytimeLevel(playtime, player)
			
			local PlaytimeDisplayValue: StringValue = Instance.new("StringValue", LeaderstatsFolder)
			PlaytimeDisplayValue.Name = "Playtime"
			PlaytimeDisplayValue.Value = UtilsFunctions.FormatPlaytime(playtime, "round")
			
			local PlaytimeOriginalValue: NumberValue = Instance.new("NumberValue", OriginalValuesFolder)
			PlaytimeOriginalValue.Name = "Playtime"
			PlaytimeOriginalValue.Value = playtime
		end,
	}
end
-- EXPORTS
export type Typedef = {
	FormatPlaytime: ((playtime: number, mode: string) -> string),
	GetPlaytimeLevel: ((playtime: number, player: Player?) -> number),
	CreatePlayerLeaderstats: ((player: Player, playtime: number) -> ())
}
-- RETURNS
return UtilsFunctions

I believe the issue for that specific error is from the player object you’re passing as an argument to your UtilsFunctions module. Could you send the code block for the “IncrementPlayerPlayerPlaytime” script on line 17.

Here it is:

LevelValue.Value = UtilsFunctions.GetPlaytimeLevel(PlaytimeOriginalValue.Value, player)