MetacoSA / QBitNinja

An Open Source and powerful blockchain API
MIT License
68 stars 42 forks source link

Server Error in '/' Application. #98

Closed kepikoi closed 5 years ago

kepikoi commented 5 years ago

I've set up everything according to the documentatation and sync'd to my storage account via 5 VMs over the weekend. Deployed the webapp via VS publishing profile with Web.config settings taken from App.config but still can't get the frontend to work. When trying to call the web app, an error 500 is returned after ca. 2 minutes. I'm getting this log from azure processes: image

Any clue what might be causing it? I've restarted the app a few times and also tried scaling up - still nothing.

Thanks

kepikoi commented 5 years ago

I redeployed with VS and the WebApp showed up. Another question: what app service plan are you using for http://api.qbit.ninja / http://tapi.qbit.ninja. Running on S1 yields really low response times (up to 2 minutes for a utxo query (e.g. /balances/15sYbVpRh6dyWycZMwPdxJWD4xbfxReeHe?unspentonly=true)

NicolasDorier commented 5 years ago

I advise D1 v2. Though long reponse time may come from something else.

I use Testnet (B3: 1) on my side using mainnet and testnet at same time there.

NicolasDorier commented 5 years ago

Also make sure your vm is in the same Location as your storage!

kepikoi commented 5 years ago

Also make sure your vm is in the same Location as your storage!

Thanks for the heads up! I learned this is especially important since additional costs will incure for the inter-regional bandwidth usage in azure.

Is it possible to run multiple vm instances with QBitNinja.Listener.Console.exe --Listen in terms of a failover strategy?

NicolasDorier commented 5 years ago

@kepikoi yes you can, though I never tested it, the underlying architecture should support it.

kepikoi commented 5 years ago

Cool! I'm running two instances right now and it seems to work just fine. I didn't notice any easing on the first VM after the second one became active, but that can have different causes.

Also the testnet instance seems to push really hard on the CPU for some reason: image

One last question - what happens with the intermediate blocks / txs if all listeners stop and get resumed eventuelly. Do the missed entities get processed after the fact?

NicolasDorier commented 5 years ago

yes, missed entities get processed. For the CPU, if you can find out what is taking much, it would be helpful.

The indexing process is idempotent, if you run two instances, they basically just index the same thing twice. (the second one is a nop)

kepikoi commented 5 years ago

I could not find a way to diagnose the cause of the high CPU load on the testnet instance but I see that over weekend the process settled back to normal.

A small issue that I found with running multiple listeners in parallel is that unconfirmed utxos appear multiple times on the balances endpoint (e.g. https://qbn9931084e322ec3bd.azurewebsites.net/balances/15sYbVpRh6dyWycZMwPdxJWD4xbfxReeHe?unspentonly=true). Once the transaction is confirmed, the redundancy no longer occur.

NicolasDorier commented 5 years ago

ok I will need to fix this.

kepikoi commented 5 years ago

Cool, Let me know if you need my assistance. I could provide you access to my api instance in a pm so you that can see the issue in effect

NicolasDorier commented 5 years ago

@kepikoi can you try latest commit? I should have fixed it properly. Reopen a new issue if not the case.