thebrumby / HotWalletClaimer

Looking to optimize your earnings with HOT tokens on the Near Protocol? How about Wave on SUI? Tree on BSC? Or Vertus on Ton? This Python script simplifies the process by monitoring your account status within popular Telegram apps, ensuring rewards are claimed at the correct time.
MIT License
84 stars 31 forks source link

Max Session Change #49

Closed bangbangbong closed 2 weeks ago

bangbangbong commented 2 weeks ago

Hello again, I have a quick question. How can I globally limit the default maximum session count? I've already tried manually editing variables.txt to set the max session to 2, then removed status.txt, and restarted Docker, but when I check via htop, the max session count is still running at 4. Any suggestions?

thebrumby commented 2 weeks ago

Hi,

HTOP is a command-line utility used to monitor processes and resources on Linux-based machines. At the top, you can see the number of CPU processors, memory usage, and swap file usage.

EVERY game session will appear in HTOP as a running process. To see these, you can filter by pressing the F4 key and typing .py. This will show all your game sessions, typically using around 0.0% CPU and about 35 MB of RAM each. The global variable "maxSessions" refers to the maximum number of concurrent claims, and applies to all games. Any game which needs to claim will first try to obtain the file lock on status.txt, and will write its session reference and start time. You said you are allowing two sessions, so the maximum number of entries inside should be 2.

If you change verboseLevel to 3 and restart all the games with pm2 restart all, you will see by typing pm2 logs that only two will be actively claiming, and the rest will say waiting for a claim slot.

Back to HTOP! - On my system, replacing the filter .py with go displays some PM2 God Daemons and any Chromium processes. If there are no active claim sessions, there will be no lines for Chromium.

For example, if I open a new terminal window and restart one of my wallets (e.g., pm2 restart HOT:Wallet1), I will see a couple of lines for the Chromium processes appear, along with increased CPU and memory usage in the top left.

What information are you using to determine how many claim sessions are running at once?

Thanks

image image image
bangbangbong commented 2 weeks ago

Screenshot_2 Task: 4 Running

thebrumby commented 2 weeks ago

I don't understand your logic?

That list of 33 or whatever are all running, they are just not actively making a claim. What makes you think any are claiming?

Wellynounet commented 2 weeks ago

no you misunderstand htop has nothing to do with sessions in pm2

thebrumby commented 2 weeks ago

Hi,

Are you referring to the section at the top of HTOP?

You have a 4-core CPU, with all 4 cores currently handling some load. It looks like Vertus might be making a claim, but it's hard to say for certain with the information provided.

HTOP shows that you have 4 tasks actively putting load on the processor out of a total of 155 processes. The 155 is the total number of processes running on your machine and isn't directly linked to the number of games you have. However, more games typically mean more processes.

Each claim session will start additional processes, including Chromedriver and Google Chrome or Chromium, which in turn will start their own processes alongside the game itself. Once these processes reach the point where HTOP determines they are not just idle, they will be flagged as running processes. One game using multiple simultaneous processes across multiple CPU cores is a marvel of modern computing and is why the claims happen much faster than if it were one process on one CPU.

Hope this clarifies things!

bangbangbong commented 2 weeks ago

Thank you for the thorough explanation.