title: How to fix sporadic read timeout and service unavailable error in Azure Cosmos Emulator (Linux) running in docker?
body: <p>I am running  Linux cosmos emulator with below configurations (as per official Microsoft documention) on Ubuntu 20.04.3 ( I tried 18.04 as well)</p>
  <pre><code>ipaddr=&quot;`ifconfig | grep &quot;inet &quot; | grep -Fv 127.0.0.1 | awk '{print $2}' | head -n 1`&quot;
  sudo docker pull mcr.microsoft.com/cosmosdb/linux/azure-cosmos-emulator
  sudo docker run -d -p 8081:8081 -p 10251:10251 -p 10252:10252 -p 10253:10253 -p 10254:10254  -m 4g --cpus=2.0 --name=test-linux-emulator -e AZURE_COSMOS_EMULATOR_PARTITION_COUNT=10 -e AZURE_COSMOS_EMULATOR_ENABLE_DATA_PERSISTENCE=true -e AZURE_COSMOS_EMULATOR_IP_ADDRESS_OVERRIDE=$ipaddr mcr.microsoft.com/cosmosdb/linux/azure-cosmos-emulator
  </code></pre>
  <p>Also adding the certificate to Java keystore as per the official document.</p>
  <p><strong>what I am doing?</strong>
  I am running Unit testing connecting to Emulator of simple CRUD operation with atmost 1 or 2 items.
  Each test will create a container and delete the container.
  My Machine configuration is 4 core and 16 GB memory.
  I am running Junit in spring boot.</p>
  <p><strong>Whats happening?</strong>
  Sporadically unit test cases are failing with read timeout or service unavailable error. I have observed in the Emulator UI, that databases disappear sometime but emulator is always up and running.</p>
  <p><strong>Note:</strong> The same is working fine when I run cosmos DB Emulator in windows 10 (both exe and as a docker container).</p>
  <p><a href="https://i.stack.imgur.com/Jds3O.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Jds3O.png" alt="enter image description here" /></a></p>
  <p><strong>Questions:</strong></p>
  <ol>
  <li>What could be the issue when running with Linux ?</li>
  <li>Is it ok to delete cosmos container(table) and create again for each test cases?</li>
  </ol>
  <p>Any suggestion for the issue is much appreciated.</p>