Jump to content

High CPU usage durning login


mehorz

Recommended Posts

I've noticed the cpu usage spikes pretty high lately. It's happened in the past and with rs updates it disappeared (no osbot update). I use low cpu usage flag and such when running my ban checker script. I used to be able to run 20-25 on my server, now can only run about 6.

 

I suspect there's no work arounds or fixes besides dealing with it or throwing more $$$ into the server for a better CPU. It does the same thing on the real rs client too so I don't think it's an issue directly related to OSBot, but maybe one of the devs can see why it spikes so badly and be able to inject some code to add a sleep or something in the loop? The spike seems to kick off right when clicking login and the client is waiting for the server's reply.

 

 

FYI, I do have a custom login handler made, no changes to it though before and after the cpu issues. Might be worth clearing the cache files, but it does it on another server as well so I didn't try yet.

Link to comment
Share on other sites

12 hours ago, Noubish said:

Weird, and this is happening running the same farm/scripts? It can depend on different activities and other factors

What are your current server stats? 

One is more modern hardware but has smaller heat sinks so it can't run at 100% cpu or it overheats. The other one with older hardware has plenty of cooling, but of course older hardware isn't as fast which is what I'm mainly basing things on since it's the one that's used the most (24/7 since 2019 basically). It has 32gb ram 6 core phenom 2 amd cpu 3.3ghz black edition (on stock clock). It sucks a good deal of power, but it's what I have on hand. I've been using this server for years, and the script hasn't changed to cause the cpu issues. The only changes are after the cpu spiked the first time I added some extra sleeps in possible areas that could spike cpu usage with no change.

 

Like I said, I can recreate the issue with the official client, it started back up with the cpu problems at the last rs update and it has come and went in the past a couple times or so. The script effected the most by this has barely changed since 2019. I haven't tried other bot clients to see if anyone has detected the issue and figured out a workaround/solution to it. I'm sure it's quite a niche issue that most people don't notice it. If I had more time to learn how a bot client is made, I'd probably be able to figure out what's going on exactly. I know RSA encryption is part of the login protocol, but encrypting a message isn't hard for the cpu and 1000's of messages can be encrypted very quickly. This is more like a wait loop with no sleep in Jagex's code, or they intentionally make it high cpu by performing some useless task like md5 junk data 100k times. It comes and goes with rs updates, so I'm almost positive it's 100% jagex's code side of things. If it's just a bad loop or useless processing, I don't think it would be too hard to skip over the work load or add a small sleep. It could be possible they have a different protocol for login sometimes that requires more work to be done (say the 100k md5 thing, but with the password) and they use that to validate if the password matches what they have pre-processed.

 

When the cpu issue happens, java is using 100% usage of a single cpu core. Before the same area of the login would take around 5-20% (1-4% overall cpu usage vs 17%).

 

I suspect in 1-2 rs updates it will be gone again.

Edited by mehorz
Link to comment
Share on other sites

55 minutes ago, mehorz said:

One is more modern hardware but has smaller heat sinks so it can't run at 100% cpu or it overheats. The other one with older hardware has plenty of cooling, but of course older hardware isn't as fast which is what I'm mainly basing things on since it's the one that's used the most (24/7 since 2019 basically). It has 32gb ram 6 core phenom 2 amd cpu 3.3ghz black edition (on stock clock). It sucks a good deal of power, but it's what I have on hand. I've been using this server for years, and the script hasn't changed to cause the cpu issues. The only changes are after the cpu spiked the first time I added some extra sleeps in possible areas that could spike cpu usage with no change.

 

Like I said, I can recreate the issue with the official client, it started back up with the cpu problems at the last rs update and it has come and went in the past a couple times or so. The script effected the most by this has barely changed since 2019. I haven't tried other bot clients to see if anyone has detected the issue and figured out a workaround/solution to it. I'm sure it's quite a niche issue that most people don't notice it. If I had more time to learn how a bot client is made, I'd probably be able to figure out what's going on exactly. I know RSA encryption is part of the login protocol, but encrypting a message isn't hard for the cpu and 1000's of messages can be encrypted very quickly. This is more like a wait loop with no sleep in Jagex's code, or they intentionally make it high cpu by performing some useless task like md5 junk data 100k times. It comes and goes with rs updates, so I'm almost positive it's 100% jagex's code side of things. If it's just a bad loop or useless processing, I don't think it would be too hard to skip over the work load or add a small sleep. It could be possible they have a different protocol for login sometimes that requires more work to be done (say the 100k md5 thing, but with the password) and they use that to validate if the password matches what they have pre-processed.

 

When the cpu issue happens, java is using 100% usage of a single cpu core. Before the same area of the login would take around 5-20% (1-4% overall cpu usage vs 17%).

 

I suspect in 1-2 rs updates it will be gone again.

Yeah I agree its rather niche I haven't noticed it too much however when I check sometimes I see lag when logging in. If I had to guess it probably has something to do with the 3rd party client update and checking what client you are using to login. 

Link to comment
Share on other sites

23 hours ago, natever said:

Yeah I agree its rather niche I haven't noticed it too much however when I check sometimes I see lag when logging in. If I had to guess it probably has something to do with the 3rd party client update and checking what client you are using to login. 

 

Yea I've thought about that, maybe it's trying to md5 each module in memory or something similar. Whatever it's processing, if it doesn't change it seems like it would be possible to inject the module, let it process through the first time through to get the right answers, then use the cached answer and skip the processing. I've touched into byte code and reverse engineering a tiny bit on JAR's but I'm not far enough to do much more. My method of injecting modules is probably detectable but it worked well enough for my old project I was poking at.

 

I've had the idea of attempting to build a headless client, I suspect the protocol under the hood doesn't change, but the op codes are shuffled every update or something like that. For sure not an impossible task, but there's a lot of work involved. For osbot to do something similar, they'd probably need to inject the client to remove the encryption from the protocol, or at least update the keys to their own and host a man in the middle attack server to monitor messages, then forward to the real server and log replies and such. Basically have a way to test each update before it's pushed out so there's not a mass ban from a tiny change. I think it would be a really awesome route to go, but it's also a lot harder to pull off I think too. One server could run 500-1000 bots I'd think. I know there's some headless clients out there, but I don't think there's anything open for the average botter to get access to. It's clearly something that would probably cripple runescape if it hit mainstream, the login servers have a hard enough time as it is.

Link to comment
Share on other sites

I dug back in some chat logs. Looks like last time I noticed this high CPU usage issue at login was Sept 2nd 2021. It was a while back, but it seems like it came, got fixed, then came back shortly after and it stuck around a week, then dissapeared for a long time. Around 2 weeks ago it showed up and went away shortly after, about the time the mass bans happened for the client detection.

Link to comment
Share on other sites

2 hours ago, mehorz said:

I dug back in some chat logs. Looks like last time I noticed this high CPU usage issue at login was Sept 2nd 2021. It was a while back, but it seems like it came, got fixed, then came back shortly after and it stuck around a week, then dissapeared for a long time. Around 2 weeks ago it showed up and went away shortly after, about the time the mass bans happened for the client detection.

Yeah that sounds about right I guess we will see in a few weeks where it stands and what happens.

Link to comment
Share on other sites

Well, there's an RS update, and long and behold, cpu issues gone again. Osbot didn't update that I saw (using CLI to start). I've been getting a lot of failures to start in the last couple months, could be my proxies though. Oh one got a different error I  haven't seen yet. Could be proxy or the osbot server is slow for some reason. Kind of weird though, once the bot is up and running I never have connection issues to rs. Sucks I always have to babysit the startups.

 

8fe2a2dd248c967d83ef767d14759a64.png

 

Anyway, unrelated to the orig post's problem, hopefully cpu issues stay away for months again.

Edited by mehorz
Link to comment
Share on other sites

17 hours ago, mehorz said:

Well, there's an RS update, and long and behold, cpu issues gone again. Osbot didn't update that I saw (using CLI to start). I've been getting a lot of failures to start in the last couple months, could be my proxies though. Oh one got a different error I  haven't seen yet. Could be proxy or the osbot server is slow for some reason. Kind of weird though, once the bot is up and running I never have connection issues to rs. Sucks I always have to babysit the startups.

 

8fe2a2dd248c967d83ef767d14759a64.png

 

Anyway, unrelated to the orig post's problem, hopefully cpu issues stay away for months again.

I also can't start my client as it gives this same error. I have VIP and should work normally. The error i get is "bot initiazion error"

 

Link to comment
Share on other sites

On 7/14/2022 at 6:10 AM, pieterttt said:

I also can't start my client as it gives this same error. I have VIP and should work normally. The error i get is "bot initiazion error"

 

Yea the bot initialization error is the common one I get. It happens right at script load time, either it's an issue communicating to the osbot servers for the account auth to make sure it's a VIP+ user, or it's failing to load RS from what I can tell. That's why I have to babysit the startup even though CLI shouldn't need to be babysat as it's command line started. I've been having 30-50% failures lately.

Link to comment
Share on other sites

Welp, high cpu issue seems to be back. No rs update, it just suddenly went high cpu while running the script (right in the middle of a batch).

I wonder if this is jagex's response to lower the load on their login server by making the clients have to do more work in order to attempt to login. Like maybe if their server is being flooded atm, it's a way to slow down the flood so their server doesn't get effectively ddos'ed. I know their login server has been pretty bad at times so I can only assume they are bombarded by a ton of login requests or something.

Link to comment
Share on other sites

20 minutes ago, mehorz said:

Welp, high cpu issue seems to be back. No rs update, it just suddenly went high cpu while running the script (right in the middle of a batch).

I wonder if this is jagex's response to lower the load on their login server by making the clients have to do more work in order to attempt to login. Like maybe if their server is being flooded atm, it's a way to slow down the flood so their server doesn't get effectively ddos'ed. I know their login server has been pretty bad at times so I can only assume they are bombarded by a ton of login requests or something.

Heard from some people that last week or so and especially recently people have been getting forced logged out on their accounts no bans or anything just kicked from the server.

Link to comment
Share on other sites

On 7/19/2022 at 12:15 AM, natever said:

Heard from some people that last week or so and especially recently people have been getting forced logged out on their accounts no bans or anything just kicked from the server.

That's interesting. Right after the update I started up the script, all was well for a short time then cpu issues came back. Almost seems like it relates to if jagex's login server is seeing a high load, the clients are doing something extra to make logins take longer. The issue changes a little too, at first I could run around 11 on my server (normally run 25-30), now I'm running 8 and it's almost hitting solid 100% cpu usage. Haven't had time lately, but thinking about trying another botting client to see if the issue exists there and port my code over. I'd assume it would be there, but I heard rumor it's not as bad on some other clients, their low cpu usage mode or something seems to help against the issue. Can't really speculate too much with out actually testing.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...