Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6689609
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T05:32:22+00:00 2026-05-26T05:32:22+00:00

I am working in Python on localhost. I wrote a raw server just read

  • 0

I am working in Python on localhost. I wrote a raw server just read TCP socket, say in port 50001.

Then I tried max client connections:

def rawMultiConn(threadnum = 10000):
    g_event = threading.Event()
    def threadfn():
        sockets = [socket.socket(socket.AF_INET, socket.SOCK_STREAM)
                   for i in range(threadnum)]
        for s in sockets:
            s.connect(('localhost', SERVER_PORT))
        g_event.wait()
        for s in sockets: s.close()

    t = threading.Thread(target = threadfn)
    t.start()
    g_event.set()
    t.join()

but after about 3000 connections, exception occurs:

[Errno 10055] An operation on a socket could not be performed because
the system lacked sufficient buffer space or because a queue was full

So how can I resolve it and max the connection?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T05:32:22+00:00Added an answer on May 26, 2026 at 5:32 am

    Check the ulimit and quota for the box and the user running the script. /etc/security/limits.conf may also contain resource restrictions that you might want to modify.

    Try running ulimit -s unlimited.

    Also, ulimit -n will show the max number of open file descriptors/sockets allowed. That may need modification as well.


    Some man pages and reference links:

    • ulimit
    • quota
    • limits.conf
    • lsof
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've been working with python for a while now and am just starting to
I have a working Python 2.6 install and just installed the PyQt4 built for
I'm currently working on a simple Python script that connects to an IP/Port and
I have django+python+apache2+mod_python installed hosted and working on ubuntu server/ linode VPS. php5 is
Working with python interactively, it's sometimes necessary to display a result which is some
Working with Python in Emacs if I want to add a try/except to a
I was working with Python with a Linux terminal screen . When I typed:
now I am working with python. So one question about dict .... suppose I
I am working in python on appengine. I am trying to create what is
I have recently been working with Python using Komodo Edit and other simpler editors

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.