Python Forum
performance in network host of manager in multiprocessing
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
performance in network host of manager in multiprocessing
#1
Hi
I run my own project with gunicorn (multi worker) and I wanted to share objects between processes. I used BaseManager from the multiprocessing python package. my project is Django and this is part of code:

def get_bloom_filter_shared_state():
    manager = BaseManager(
        ('127.0.0.1', '8004'),
        b'blabla'
    )
    m_bloom_filter = BloomFilter()
    a_bloom_filter = BloomFilter()

    # n_share_state: memory sharing already exists or new.
    n_share_state = False

    # register in manager
    manager.register('m_bloom_filter', lambda: m_bloom_filter)
    manager.register('a_bloom_filter', lambda: a_bloom_filter)

    try:
        manager.get_server()
        manager.start()
        n_share_state = True

    except OSError:
        # Address already in use
        manager.connect()

    return manager.m_bloom_filter(), manager.a_bloom_filter(), n_share_state
Is the performance of the network low in many requests? What is the performance of this host (127.0.0.1)?
Reply


Messages In This Thread
performance in network host of manager in multiprocessing - by rmaleki - Mar-06-2022, 02:09 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Netmiko Program ssh from the Jumpssh ( host -> Jumphost -> Network Device matya0403 3 6,937 Jul-31-2020, 08:22 AM
Last Post: dtw
  how virtual and host can communicate? looney99 0 2,130 Nov-28-2019, 09:08 PM
Last Post: looney99
  virtual host and real network communicate looney99 3 2,927 Nov-20-2019, 12:27 PM
Last Post: ChislaineWijdeven

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020