title: Python + WSGI + Eventlet Websockets (100% CPU)
body: <p>I am currently working with WSGI, Eventlet and REDIS to create a websocket server. We are seeing a very high CPU load for what I would expect with the number of connections.</p>
  
  <p>We have around 2000 connections to the websocket server which push information once roughly every 1m30s. The info is captured and placed into the REDIS DB, if there any messages waiting for the client then the messages are sent back in reply.</p>
  
  <p>Python version 2.7</p>
  
  <p>The wsgi setup looks like the below
    wsgi.server(eventlet.listen(('127.0.0.1',8000),backlog=5000),hello_world,max_size=5000)</p>
  
  <p>I have patched the eventlet lib at the script start using</p>
  
  <pre><code>import eventlet
  eventlet.monkey_patch()
  </code></pre>
  
  <p>To hopefully get around any Redis related deadlocks causing high CPU. </p>
  
  <p>The server is a EC2 C4 large running on Ubuntu 16.04. <a href="https://aws.amazon.com/ec2/instance-types/" rel="nofollow noreferrer">Amazon</a></p>
  
  <p>Nothing else is running on the server other than this script to 100% CPU seems very high to me but perhaps my expectations are incorrect.</p>
  
  <p>Can anyone help with perhaps some common gotchas?</p>