[bisq-network/bisq-markets] Re-implement Markets API service with pre-caching proxy + risq backend (#20)

dan-da notifications at github.com
Mon Nov 11 06:37:15 UTC 2019


Hey that's cool if you guys want to re-write the API... more power to you.  And the risq project is exciting.  However the statements about the original markets API not having any cache are factually incorrect.

First, the [README](https://github.com/bisq-network/bisq-markets#requirements) lists under Requirements:
  **opcache extension. ( for data caching. will run without, but much slower. )**

Second, have a look at this file:  https://github.com/bisq-network/bisq-markets/blob/master/lib/filecache.class.php

This filecache class is used by each of the data classes when retrieving data from the underlying json data stores, and the filecache stores data in mem across requests... something that is tricky to do in php.

I wonder if opcache extension was somehow not enabled when the site was moved to new server.  If so, that would degrade performance **immensely** as the filecache drops back to reading json file for each request.  If it is enabled, then i'd be very curious what kind of reqs/sec you are getting because for example the /depth API handles 900 reqs/sec on a nearly 10 year old laptop.  And according to this [comment](https://github.com/bisq-network/bisq-markets/blob/master/lib/filecache.class.php#L39) in the code, the trades api was clocked at 1450 reqs/sec (on the old server).

An easy way to check:  look if /tmp/bisq_opcache/ exists on the server and recent files are in it.  Also check for setting of opcache.enabled in phpinfo() output.

Of course, there could be a bug or other code issue, but I would need to see an example of a specific query that is executing slowly.  do you have one?

Another thing... the old server had fail2ban rules in place that would read apache logs and auto-ban IPs if they were hitting the site too much.  This was put in place due to DDOS attacks early on and worked quite well after a bit of tweaking.  Correct me if wrong, but I'm guessing those did not get migrated.

All that said, the server constantly writing out huge json files was never going to scale forever if trade volume were to explode, so you likely have a more future-proof design.  I'm a bit skeptical though that the limits of the old system are actually being hit yet.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/bisq-network/bisq-markets/pull/20#issuecomment-552313281
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bisq.network/pipermail/bisq-github/attachments/20191110/ad297540/attachment.html>


More information about the bisq-github mailing list