Delay in call response + shipping the blockchain + deamon size

16 views
Skip to first unread message

Arco

unread,
May 6, 2015, 5:54:44 AM5/6/15
to twist...@googlegroups.com
Hi,

I have three questions again, related to the Windows client I am working on.

1.Delay in call response
The past few days I have been testing new instances of Twister/Twisting and I noticed that when starting a new instance the deamon responses really badly for about 15 to 20 minutes. The following is the process I go through:
  • Start Twisting
  • Start the deamon in the background
  • Make sure the blockchain is up to date + there is at least one connection
  • Make the user logs in his account
  • Get following of user
  • Follow all those users
  • Go the 'main feed'
  • Call getposts to get the latest posts (getposts 2- '[{"username":"arco"}, {"username":"john"}, {"username":"smith"}, ... + 130 other users ... ]'
This latest call, getposts returns some posts just after the user logged in, but one minute later the call doesn't get a response at all. I did notice though, that calling the getposts call with only one user does get a response after a while. (Is it bad practise to call getposts with all the users the user follows?)

During this time I took a look at the debug.log and nothing seemed to happen. The only thing the deamon did was 'adding torrent for user [<random username>]'

A possible cause might be that I am not shipping the right files of the blockchain, so the deamon is processing this database or whatsoever. See next question.

All in all the problem is that I can't show the user any posts when the client gets started for the first time. Making the user wait for 15 to 20 minutes isn't really an option though.

2.Shipping the blockchain
I'm want to ship the blockchain together with the application, I hope this is not bad practice? Which files should I ship exactly. At the moment I ship the following, and it seems to work fine but I would like to be sure that I am not sharing private or unnecessary data:
  • The folder blocks
  • The folder chainstate
  • twister.conf
3. Deamon size
The deamon (twisterd.exe) size of the Windows build I have is 147MB. Seems a bit big for a data processing application. Is this correct or did something go wrong with building maybe? I don't have a Linux instance to compare it with at the moment.

That's it! Once again, thanks for your time :-)

Arco

Miguel Freitas

unread,
May 18, 2015, 9:09:56 PM5/18/15
to twist...@googlegroups.com
On Wed, May 6, 2015 at 6:54 AM, Arco <arco...@gmail.com> wrote:
1.Delay in call response
(...) 
  • Call getposts to get the latest posts (getposts 2- '[{"username":"arco"}, {"username":"john"}, {"username":"smith"}, ... + 130 other users ... ]'
This latest call, getposts returns some posts just after the user logged in, but one minute later the call doesn't get a response at all.

Just to clarify: does it mean the response is empty or that the call doesn't return?

Did you try increasing -rpcthreads= ? 

by default there are only 10 threads to service RPC calls (help says 4, but it is wrong). standard twister-html client performs 6 simultaneous requests.
 
I did notice though, that calling the getposts call with only one user does get a response after a while. (Is it bad practise to call getposts with all the users the user follows?)

No, that's the correct practice. Did you notice any cpu increased load due to using all  usernames? this is an interesting case to investigate.
 

During this time I took a look at the debug.log and nothing seemed to happen. The only thing the deamon did was 'adding torrent for user [<random username>]'

Some mutexes may be held during that phase, but if they take such a long time (to affect getposts) then i would qualify it as a bug.
 

A possible cause might be that I am not shipping the right files of the blockchain, so the deamon is processing this database or whatsoever. See next question.


but this is usually shown in log (a frenetic blockchain activity validating blocks).
 
All in all the problem is that I can't show the user any posts when the client gets started for the first time. Making the user wait for 15 to 20 minutes isn't really an option though.

agreed.
 

2.Shipping the blockchain
I'm want to ship the blockchain together with the application, I hope this is not bad practice?

No, sounds good.
 
Which files should I ship exactly. At the moment I ship the following, and it seems to work fine but I would like to be sure that I am not sharing private or unnecessary data:
  • The folder blocks
  • The folder chainstate

I'd need to research this (it is just plain/old Bitcoin code, i didn't wrote that part) but that seems correct imho.
 
  • twister.conf

I prefer to generate twister.conf for each installation, so we may set random rpcpassword instead of shipping a fixed file.
 
3. Deamon size
The deamon (twisterd.exe) size of the Windows build I have is 147MB. Seems a bit big for a data processing application. Is this correct or did something go wrong with building maybe? I don't have a Linux instance to compare it with at the moment.

Just try "strip twisterd.exe". iirc that should reduce it to about 10-20 MB by removing debug information.
 
regards,

Miguel

Reply all
Reply to author
Forward
0 new messages