Jump to content

goensch

Members
  • Posts

    13
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

goensch's Achievements

Apprentice

Apprentice (3/14)

  • Collaborator Rare
  • First Post Rare
  • Conversation Starter Rare
  • One Year In Rare
  • Week One Done Rare

Recent Badges

0

Reputation

  1. Now it works. It was the whitespaces.... I love languages with {} (or begin end) , that is a strange idea. Anyways, thanks to MoneyBroz and Krydos (in the Discord)
  2. I think I have something to start with.... seems to be an issue with blanks in my code. ... Whitespaces...
  3. Thanks it is 3.10 on Tommy. Regarding stopping, I want to use the above code. With psutil process terminate. I saw psutil is installed. But Krydos also told me is is always installed. I assumed getpid is part of os. The include looked like that.... But I do not really know Python. It is not the include line. It is as soon as I remove a # In front of the line using getpid. I out comment all lines and activated them top to bottom.
  4. Sorry. As soon as I include getpid it does not run.
  5. Hi, I have a scheduled task. Sometimes it does not run through, the next is started.... It adds up and eats memory. So I want to check for a previous insta ce running and kill it. This is my idea: print("test " ) from os import getpid from os.path import exists from psutil import pid_exists, Process PATH_PIDFILE = "../pid.txt" my_pid = getpid() if exists(PATH_PIDFILE): with open(PATH_PIDFILE) as f: pid = f.read() pid = int(pid) if pid.isnumeric() else None if pid is not None and pid_exists(pid) and Process(pid).cmdline() == Process(my_pid).cmdline(): # Exists # Kill p = psutil.Process(pid) p.terminate() #print("killed ") with open(PATH_PIDFILE, "w") as f: f.write(str(my_pid)) Howorever a soon as I cute getpid linee it doesn't run anymore
  6. Hi there, yesterday Krydos gave me some good advice on avoiding the high load in the future, I'll implement this. The topic was marked as "solved". That is why I am opening a new topic. My account is still suspended (I guess you forgot to reactivate). Can you please reactivate? I'll implement the changes asap and hope it helps. Thanks, Jochen
  7. Hi, I am sorry for causing trouble again. Could you please unsuspend my account goensch on Tommy? Thanks. Regarding what causes the load: I regularly run some Python scripts. Load used to be about 25 CPU and 30 memory (in the graph, I think it is 2500 and 30000). Then, suddenly memory shoots to 100 (I guess the max of the graph). Of course, I have some ideas for incremental incremental improvements, but it is strange the setup worked for more than a year. Anyways, maybe you guys have ideas: I run the scripts as scheduled tasks, using the "fetch website" functionality. Initially, I searched for a way to "directly" call a python, but did not succeed. Is this possible and my it help? My theory is that a task gets stuck. Then, later, the next one is called, gets also stuck.... so memory usage adds up. Is there a possibility to automatically kill the tasks after , say, 2 minutes if they are still running? Thanks a lot, Jochen
  8. Thanks a lot. Strange, I did not do any changes yesterday. But I noticed a job did not run through, a phyton script. Is it possible if this happens several times, it remains stuck and keeps consuming memory?
  9. Hi, my account goensch was suspended for high load. Please reactivate. On Tommy. Thanks. What is strange: I had this 2 weeks ago. Back then, I new the reason, solved it. Then I checked in dashboard for a few days and was at 4000 CPU . Since then, I changed nothing. So, I guess Tommy got slower? Anyways, I will try to further optimize. Jochen
  10. Thanks. I hope so. The dashboard graph was at 100 for memory and 40 for CPU. So memory was the issue?
  11. Ah, my account is goensch on Tommy.
  12. Hi. My account was suspended due to high load. I guess it is CPU? I will disable the precalculation of a website first. Then I will try to make it more efficient. And check the status. Sorry for that. Jochen
×
×
  • Create New...