Jump to content

optimizing for ram and cpu for a serious farm


BigCahunaBurger

Recommended Posts

For farming

https://osbot.org/forum/topic/127346-osbot-memory-usage/

 

Alek talked about max heap size

If I want to limit the heap size, are there any recommended levels?

Alternatively, it's pretty easy to upgrade my ram to like 250GB but I'm stuck at 24mb of cache regardless of cpu upgrades. Is there a way to increase my heap size and reduce my garbage collection?

I'm planning on removing webwalking from my scripts entirely and replacing it with path. Webwalking seems to use too much ram for a serious farm

Is there a way to run multiple bots in one cli? That way I don't need multiple separate instances of osbot open (I'm assuming this will use more ram)

I realize I tried to do way too much with one script and will now segment it into multiple small scripts that are as tiny as possible, with only one if/then case handling logic in the main loop and only a few if/then conditions per script. The complex script executes fine but at scale seems to be unnecessarily large and likely is hogging more cpu and ram than need be. The logic for handling progressions or changes in the script seems better suited by just exiting the script at the point it should change and starting a new script

I am already using the nointerfaces and low cpu cli commands

What are some recommended refactoring tips for scripts to minimize ram and cpu usage? Any way I can check to see how big the heap should be with my script? I think I'm thinking of using a memory debugger

 

I read looping more slowly can reduce usage also? How to reduce the loop to once per minute?

Edited by BigCahunaBurger
Link to comment
Share on other sites

OK, I think I figured out one of the biggest problems here for overuse of the CPU. I was using recursive logic. I'm honestly more of a LISP than a Java guy. I didn't realize that recursion is totally discouraged in Java. I can use it in Clojure and possibly export the clojure jar to osbot, but that is unnecessary work at this level

Link to comment
Share on other sites

Making stuff static should mean it won't be garbage collected, which should reduce CPU utilization. I'll compare and contrast. I think pathwalking (not webwalking), preventing unnecessary looping (ensuring the main loop does not re-execute prematurely) combined with static variables / objects should reduce the CPU a lot.

Link to comment
Share on other sites

24 minutes ago, Chris said:


yes make a batch script: https://www.howtogeek.com/263177/how-to-write-a-batch-script-on-windows/

cli will open multiple clients

Thanks Chris, I guess what I'm wondering though is whether you can use the -bot parameter for more than one bot? (So one client for many bots)

 

Like

java -jar osbot.jar -bot user1:pass1 user2:pass2 user3:pass3 etc

 

RIP to Zyzz king

Link to comment
Share on other sites

18 minutes ago, BigCahunaBurger said:

Thanks Chris, I guess what I'm wondering though is whether you can use the -bot parameter for more than one bot? (So one client for many bots)

RIP to Zyzz king

I believe currently its 1 bot per client. you could ask @Patrick
f7cdc219b5dc433d49b64c8be73fc7cf.png

 

Quote

 

Like

java -jar osbot.jar -bot user1:pass1 user2:pass2 user3:pass3 etc

 

correct. you would add a timeout of 5s or so and make a new line for each java -jar line.

 

  • Like 1
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...