Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 9 years ago.
Improve this question
I'm working on 2-level cache (1-st is RAM and 2-nd is FS) in Java. I implemented first level for now.
Could you please clarify:
How to make good testing for my cache implementation?
Which scenarios are typical for using cache in java application?
For now my testing scenario is just 5-20 threads which try to put and get data from cache.
But I suppose that it's not typical case...
You really need to know some statistics about the requests being made in order to properly test it.
You could go ahead and test 3 scenarios where you have a special setup for starters:
Setup: 200 MB RAM, 5 GB FS space.
Test 1: Only do queries that you know are in the RAM.
Test 2: Do a percentage queries that you know are in the RAM, and the other queries must be fetched from the file system.
Test 3: Do 100% requests that you know must be selected from the FS.
If you do these tests, you'll have 3 coordinates that will give you an idea of the performance for each layer. If you want to be more thorough then add 25% and 75% or more increment percentages.
If you have access to some "live testing", meaning real requests that you're trying to speed up, then create some statistics for your requests and base your cache on those instead of trying to solve a general "caching" problem.
Related
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 4 years ago.
Improve this question
I'm looking for the optimal way to handle the following scenario, preferably some implementation that's already been made for something like this.
There are two Systems (Springboot Webapps) that are supposed to communicate which each other through a Rest-gateway. Transfers shall be handled with Json over HTTP.
1st System is the Project part, 2nd System is the Persons part and they both implement their own persistent sql-database. Both systems depend on each others data and it cannot be expected that both systems are online at all times.
What would be the best way to achieve that both systems data is always up 2 date? Is there any plugin you could recommend to handle the synchronization process which also implements scenarios like one system shutting down while sending or the other way round?
Thanks in advance!
If you can't expect both systems to be online at all times, and you don't want any downtime when one of them is down, I think that the best way to do it is to share a common database. This has some problems of its own and you should think if it's worth, maybe you would be better having two completely independent services which rely on each other and being ready to replicate one of them if it's needed.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 years ago.
Improve this question
for my master thesis, I have to modify Cassandra (I want to make a distributed version where different clusters will send the modifications with some dependencies and stuff :) ). So, I am starting to finally understand the code and I think I know how to do it, but I have encountered a problem:
I have to run different instances of cassandra on my computer (so I would have like 3 terminals running cassandra on different addresses, and 3 others terminal open with cqlsh for each cassandra, and when I insert values in a table with one terminal cqlsh, it will only affect the corresponding cassandra cluster) . I have found different ways on internet to do it, but every times, you should duplicate the binaries (so the code in my case), and since I am working on it, I don't want to duplicate it, because every time I make a small modification, I should reduplicate everything (I guess I could use a git to easily push and pull the modification from the original folder, but I am sure that there should be an easier way, right? :) )
thank you in advance :)
PS: I use windows (I can switch to linux (virtual box) but I would like to continue to work on windows if possible) and cassandra 3.10
take a look at cassandra ccm, it allows you to run multiple instances on the same physical machine. (used mostly for testing)
https://github.com/pcmanus/ccm
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
I'm currently rewriting a Ruby on Rails web app in Spring Boot. A big part of the move is for performance.
Whilst developing the app, when I hit run in IntelliJ the first response time is typically around 1s which I assume is JVM startup, after a refresh it'll jump down to 300ms~ then 150ms for 4-5 further requests, after that it settles on 50-75ms for the most part. Randomly though later on I'll get a 150ms response again.
As a JVM novice I'm wondering what factors are at play here in the varying response times? which would be closer to the standard "hot" response times that I could expect in production? I realise I'm unlikely to get an accurate depiction of production performance on my local dev machine but would like to understand the variance seen above so I can at least gauge a little better what affect my incremental changes are having.
As a JVM novice I'm wondering what factors are at play here in the varying response times?
startup:
jit warmup
lazy initialization as part of your application
GC needing to settle on some heap size
steady state:
GC pauses
application behavior, e.g. cache entries expiring every now and then
varying load
JIT deoptimizations/recompilations due to some uncommon paths being taken
thermal CPU throttling, especially on but not exclusive to laptops
For server applications you should ignore the ramp-up behavior and focus on steady state. And guessing what the issue might be will not help, measurements are king.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
Recently i was asked in an interview , how to read huge file (single file of 1TB) in java.I said by using Threading , we will create two File objects and one thread will read it from the beginning and other Thread will read from last. May be this is Stupid answer.And the Interviewer gave hint , by using Horizontal/Vertical Scaling , Clustering.
I have seen in Google there is no Example for Horizontal/Vertical Scaling , Clustering and reading files.can anyone help
This interview question is quite open; it tries to have you talk and think out loud. There will be many answers.
My personal interpretation:
Both scaling do not refer to classes or frameworks. They are concepts in architectures. Start with wikipedia if you are not clear on that.
Vertical scaling: here they probably want you to see how you can improve performance on a single host to get this huge file job done. This involves better disks, raid, multithreading of course. If any CPU/memory is heavily loaded, perhaps having more cpu and memory.
Horizontal scaling: this is usually about how to divide the problem across multiple jvm hosts to have the file processed concurrently, in a divide and conquer, scatter/gather pattern.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 9 years ago.
Improve this question
I am busy doing some research and I need to do a comparison between two methods of system monitoring. I have to compare the total memory of overhead and computation required when queries are made to an external software package (i.e one that I did not create but running on the same system) as well the overhead in my software package (written in JAVA) when including all the libraries and making all the queries.
Does anyone have any suggestions on how I can approach this task to achieve these goals? Are there any general profiling solutions available that just "plug" into your system monitor and retrieve the system statistics this way? Or just a pointer in the right direction would be more than helpful right now as I am completely stuck :/
Thanks in advance.
You can use VisualVM (For sure in Windows, but don't know about Linux) (or) You can write a simple program using JMX API.