title: Can't start clickhouse service, too many files in ../data/default/<TableName>
body: <p>I have a strange problem with my standalone clickhouse-server installation. Server was running for some time with nearly default config, except data and tmp directories was replaced to separate disk: </p>
  
  <pre><code>cat /etc/clickhouse-server/config.d/my_config.xml 
  &lt;?xml version="1.0"?&gt; 
  &lt;yandex&gt; 
    &lt;path&gt;/data/clickhouse/&lt;/path&gt; 
    &lt;tmp_path&gt;/data/clickhouse/tmp/&lt;/tmp_path&gt; 
  &lt;/yandex&gt;
  </code></pre>
  
  <p>Today the server stopped responding with connection refused error. It was rebooted and after that the service couldn't completely start: </p>
  
  <pre><code>2018.05.28 13:15:44.248373 [ 2 ] &lt;Information&gt; DatabaseOrdinary (default): 42.86%
  2018.05.28 13:15:44.259860 [ 2 ] &lt;Debug&gt; default.event_4648 (Data): Loading data parts
  2018.05.28 13:16:02.531851 [ 2 ] &lt;Debug&gt; default.event_4648 (Data): Loaded data parts (2168 items)
  2018.05.28 13:16:02.532130 [ 2 ] &lt;Information&gt; DatabaseOrdinary (default): 57.14%
  2018.05.28 13:16:02.534622 [ 2 ] &lt;Debug&gt; default.event_5156 (Data): Loading data parts
  2018.05.28 13:34:01.731053 [ 3 ] &lt;Information&gt; Application: Received termination signal (Terminated)
  </code></pre>
  
  <p>Really, I stopped process on 57%, because it starts too long(maybe it could start in an hour or two, I didn't try). </p>
  
  <p>The log level by default is "trace", but I didn't show any reasons of such behavior.</p>
  
  <p>I think the problem is in file count in /data/clickhouse/data/default/event_5156. 
  Now it is 626023 directories in it and ls -la command do not work in this catalog properly, I have to use find to count files:</p>
  
  <pre><code>#  time find . -maxdepth 1 | wc -l
  626023
  
  real    5m0.302s
  user    0m3.114s
  sys     0m24.848s
  </code></pre>
  
  <p>I have two questions:</p>
  
  <p>1)Why Clickhouse-Server generated so much files and directories, with default config?</p>
  
  <p>2)How can I start the service without data loss in adequate time?</p>