home.social

#psutil — Public Fediverse posts

Live and recent posts from across the Fediverse tagged #psutil, aggregated by home.social.

fetched live
  1. Beginner-friendly 204-line Python script that polls CPU, RAM, disk IO and network and writes metrics to JSON. Handy for checking box health before users complain. #python #infra #psutil valtersit.com/python/system-me

  2. Glances on macOS crashed with:

    SystemError: <built-in function proc_cmdline> returned a result with an exception set

    It's a psutil 7.2.2 bug: if a short-lived process is reaped while Glances reads it, psutil raises an error Glances doesn't catch. No fixed release yet:
    github.com/giampaolo/psutil/is
    github.com/nicolargo/glances/i

    The crash also leaves the terminal garbled. No need to close the tab: type reset, even if you can't see it, and press Enter (or Ctrl+J).

    #macOS #Python #psutil #Glances #Terminal

  3. Catch Python memory leaks in long-running workers. 219 lines, uses psutil and tracemalloc. python3 mem_leak.py --pid 1234 --interval 10 --alert-mb 500 valtersit.com/python/memory-le #python #infra #psutil

  4. 214 lines of Python to watch an interface and alert when throughput passes a threshold. Handy for edge nodes where traffic spikes sneak up. Beginner level, psutil. valtersit.com/python/network-i #python #infra #psutil

  5. 222 lines of Python that watch a process and restart it when it dies. Handles gunicorn workers, daemons, background jobs. Beginner friendly.

    valtersit.com/python/process-m

    #infra #python #psutil

  6. Ah yes, nothing says "cutting-edge tech" like freethreaded Python wheels for #psutil. 🤓 Let's gather the entire Python community to celebrate this riveting achievement of compiling some C code and throwing it into a wheel like it's 1998. 🎉 Bravo, dear developers—yet another feature that will change everything (or nothing).
    gmpy.dev/blog/2025/wheels-for- #PythonCommunity #TechNews #CCode #Innovation #Celebration #HackerNews #ngated

  7. I want to measure run time of a Python program and compare it to /usr/bin/time. The script, t.py:

    import psutil, time,
    startSecs = psutil.Process(os.getpid()).create_time()
    print("startup took %.3fs" % (time.time() - startSecs))

    run as:

    /usr/bin/time -f 'wall=%e' python3 t.py

    output:

    startup took 0.822s
    wall=0.03

    where 0.8s is quite obviously wrong, not only because of the wall=0.03, but because there is no noticeable wait of nearly a second. How come?

    #python #programming #shell #psutil

  8. #glances running on Haiku with a very crude #psutil port

    #HaikuOS

Share on Mastodon

Enter the server where you have an account.