question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

The "sum 1 billion doubles" result on the front page can be incorrect.

See original GitHub issue

I have installed QuestDB on my machine to reproduce the claimed results.

I have: AMD Ryzen 9 3950X 16-Core Processor 64 GiB RAM

QuestDB is installed as the following:

$ wget https://github.com/questdb/questdb/releases/download/5.0.0/questdb-5.0.0-bin.tar.gz
$ tar xf questdb-5.0.0-bin.tar.gz
$ sudo apt install openjdk-14-jre
$ export JAVA_HOME=/usr/lib/jvm/java-14-openjdk-amd64

./questdb.sh start

Exception in thread "main" io.questdb.network.NetworkError: [98] could not bind socket
        at io.questdb@5.0.0/io.questdb.std.ThreadLocal.initialValue(ThreadLocal.java:36)
        at java.base/java.lang.ThreadLocal.setInitialValue(ThreadLocal.java:195)
        at java.base/java.lang.ThreadLocal.get(ThreadLocal.java:172)
        at io.questdb@5.0.0/io.questdb.network.NetworkError.instance(NetworkError.java:46)
        at io.questdb@5.0.0/io.questdb.network.AbstractIODispatcher.<init>(AbstractIODispatcher.java:96)
        at io.questdb@5.0.0/io.questdb.network.IODispatcherLinux.<init>(IODispatcherLinux.java:36)
        at io.questdb@5.0.0/io.questdb.network.IODispatchers.create(IODispatchers.java:41)
        at io.questdb@5.0.0/io.questdb.cutlass.http.HttpServer.<init>(HttpServer.java:72)
        at io.questdb@5.0.0/io.questdb.cutlass.http.HttpServer.create0(HttpServer.java:148)
        at io.questdb@5.0.0/io.questdb.WorkerPoolAwareConfiguration.create(WorkerPoolAwareConfiguration.java:60)
        at io.questdb@5.0.0/io.questdb.cutlass.http.HttpServer.create(HttpServer.java:110)
        at io.questdb@5.0.0/io.questdb.ServerMain.main(ServerMain.java:145)
        
The exception message is not quite handy.

$ questdb status
questdb: command not found

The example in documentation looks wrong.

$ ./questdb.sh status

  ___                  _   ____  ____
 / _ \ _   _  ___  ___| |_|  _ \| __ )
| | | | | | |/ _ \/ __| __| | | |  _ \
| |_| | |_| |  __/\__ \ |_| |_| | |_) |
 \__\_\\__,_|\___||___/\__|____/|____/
                        www.questdb.io

Not running

The link "with the HTTP API" on the web page https://questdb.io/docs/guideBinaries goes to psql.

Looks like it is using the same port as ClickHouse, so it cannot work with default configuration.

http://localhost:9000/

SELECT 1;
-- does not work

SELECT 1 FROM dual;
-- does not work

create table zz as (select rnd_double() d from long_sequence(1000000000));
select sum(d) from zz;
-- when I copy-paste both commands to the web UI, it shows me

[16:47:58] select sum(d) from zztable does not exist [name=zz]

If I execute these commands one by one, it's Ok.

Table creation is quite slow (about ten seconds), but still Ok.

select sum(d) from zz;

Ok, sustained query time after a few runs is about 282 ms.

The sustained query time is about 282 ms.

I’m trying to reproduce the same with ClickHouse (master, clang release build):

SET max_memory_usage = '20G'
CREATE TABLE zz (x Float64) ENGINE = Memory;
INSERT INTO zz SELECT number FROM numbers_mt(1000000000)
(3.8 seconds)

SELECT sum(x) FROM zz
0.241 sec.

The sustained query time is about 240 ms.

Actually there is no much difference and ClickHouse gives slightly better results. (Or I did not follow the installation steps of QuestDB correctly?)

If I reduce the number of threads to 4 to align with the results from https://questdb.io/blog/2020/04/02/using-simd-to-aggregate-billions-of-rows-per-second ClickHouse gives 232 ms (even slightly better).

The “sum int” is executed in 0.121 (ClickHouse) vs. 0.135 (QuestDB, results on AMD Ryzen 3900X from your blog article). Again, no much difference and ClickHouse is slightly better.

I suspect that the results for ClickHouse in “sum double” benchmark were improved after https://github.com/ClickHouse/ClickHouse/pull/10992

PS. Thank you for the benchmark and for the great product!

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:16 (9 by maintainers)

github_iconTop GitHub Comments

2reactions
bluestreak01commented, Jul 17, 2020

Thank you Alexey, this is interesting! c5.metal has two 24-core CPUs. To make result more consistent in our own benchmark we set thread affinity on all 16 threads to make sure data does not have to travel between NUMA zones.

To set affinity on QuestDB:

shared.worker.affinity=1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16

That said, we are working on new version of our website, which does not feaure comparison to ClickHouse anymore:

https://v2.questdb.io/

1reaction
alexey-milovidovcommented, Jun 24, 2020

I swear it wasn’t intentional but we bind the same socket by default. We only find out when we run clickhouse on the same box as questdb 😃

No problem, the 9000 port is quite popular 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

Chapter 14: SOLUTIONS TO TEXT PROBLEMS:
1. When a competitive firm doubles the amount it sells, the price remains the same, ... The only long-lasting effect is that industry...
Read more >
Why not use Double or Float to represent currency?
Because floats and doubles cannot accurately represent the base 10 multiples that we use for money. This issue isn't just for Java, it's...
Read more >
What Is the Rule of 70? Definition, Example and Calculation
The Rule of 72 is a shortcut or rule of thumb used to estimate the number of years required to double your money...
Read more >
tsia2-mathematics-sample-questions.pdf - Accuplacer
Therefore, the sum of the scores of all 12 + 9 = 21 students in the class was 924 + 819 = 1,743,...
Read more >
3. Population Growth Based On Annual Increase
If a population of people grew from 1000 to 1040 in one year, then the percent increase or annual growth rate is 40/1000...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found