Test connection speed with Java [closed] - java

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 8 years ago.
Improve this question
I have a Java server and Java client I'm interested is there any way to test with java the performance speed and the delay time between them?
I don't want to use the standard ping.

Not sure how Effective it would be, but I think of this approach :
send some specific amount of data to server, from server send back the time the uploading is finished then calculate the time required to send the data. Result Will Be U/L time. Do the same for the D/L time. Request data from server, server should respond you with data along with the time the first bit was sent from the server. When All data is downloaded, calculate your D/L time.
Important thing to note here is, there may be the different instance of time, at server & client (& most possibly there would be), you need to Sync you time with the server time first.
send some specific amount of data to server, send back the data. Calculate the total time required. It will be your D/L + U/L time. Since the calculation would be at client only no time syncing is required here.

Related

Content Download takes too much in chrome for Web App [closed]

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 3 years ago.
Improve this question
So I have been facing this problem for quite a while and I have researched everywhere I could to find a solution for this but to no avail.
The webpage that we are designing has some performance issues so I checked the network time and it seems 95% of the time is taken by content download. I have checked logs and everything is responding quickly, all the queries runs fast and all the functions completes without any issue. I dont seem to figure out why and where content download time is coming from.
On my local machine it takes milliseconds but on server it takes around 1 min for ~220 records.
Screenshot of Network Tab on server
Screenshot of same application on my local
Request Headers on local machine
Request Headers on Server
Please any suggestion I could try. This java Spring boot application ,database is postgres
Ok so I finally I figured out why there was so much difference of time taken for content download.
Basically when on localhost all the data is downloaded directly to the machine and processed so there is no need to download any content what so ever. But incase of server, the data is downloaded on the server and processed after processing this data needs to sent to client machine and that's where content download time kicks in.
I know it's so basic but I never knew what content download is?
Anyway I was able to get content download time to under 3 secs on server by enabling gzip compression.

Checking server every 5 minutes [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 6 years ago.
Improve this question
I saw 2 approaches to check a server in Android every X time, therefore I want to ask which way is better.
My application is requesting a HTML page from a server.
First option, is to run a service with sleep time of 5 minutes.
Second option, to set an alarm manager with interval time of 5 minutes that triggers a broadcast reciver.
Glad if you can tell me which way is better, or if there is a better way.
Thank you.
I would suggest using AlarmManager and set alarms every 5 minutes and use a BroadcastReceiver to get the message.
My reason is that when you run your service in the background, if OS needs more resources it will kill your service and get its resources for other apps but with Alarms you reduce the risk of killing your app.
Regarding checking server, you should consult this manual. just a single poll request to the server will make your radio active for at least 30s and will consume your battery. So maybe you should reconsider your intervals or even your strategy.
One other note: If you are just checking the server for new data and want to be informed if something has changed you can use Cloud Messaging. You can do most of the processing in the cloud and just send the important data back to the device(s). It is more efficient
i agree with #Pooya. Also you should implement a boot receiver so that your alarm will be set if the phone is rebooted. Here is the sample app that i downloaded from http://developer.android.com/shareables/training/Scheduler.zip

Connecting java to a mysql domain server [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 6 years ago.
Improve this question
I've created a java application for our POS project and tried using heliohost.org as my domain server to sync all the data from different branches and uploaded my MySQL database in it. I've successfully connected it, and my application can access the database without any problem. However, when using the domain server there is additional latency -- when I add a product or login to my application it takes a couple of seconds before it carries out the action.
Any tips or other method to sync data from other branches to just 1 database?
Location, Resources and Load concerning the DNS server; this are the
factors that increases or decrease the performance of your DNS server.
Try to optimize this factor.
If you want full speed use your IP itself to connect to the DB server,
this will eliminate the DNS resolution time.
You can also use cloudflare or similar DNS service; they are both
fast and secure (I think it is free also).

Where to keep the response of web services? [closed]

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 8 years ago.
Improve this question
I send request to web services and receive the results, then I need to allow users to sort the results. My question is that after retrieving the results where should I keep them to be able to sort them upon user's request without sending a new request using web services?
why again sending the request to web services i think no need of sending of request again once you received the result just store them in the type what ever they are and sort it mean while and get displayed to the users
You have two choices:
Let the server sort the results before returning them to the user.
Give the client the capability to sort the results on the client side without having to make another web service call.
This is a little bit tricky as there are several choices and you should use the one, depending on your need. You can store the data temporarily in cache or cookie if you don't require any permanent storage. Otherwise, you can use memory or database.
You can also check this link:
http://blog.mafr.de/2009/01/04/session-data-in-webapps/
It highlights some possible solutions.

what is deep_ping [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
I am not sure if this is the correct forum to ask this but i am not sure where to ask either. So here is my question:
what does "deep ping" mean. I tried google but still did not get any information about it. Also who does deep ping mean in web servlet`s context. Thanks.
I'm not sure it's the "official definition" if there is such a thing, but I've head "deep ping" used about functionality that allows you to (in contrast to a regular ping) send a message to the server that passes through as much of the webstack as possible before returning an "ok" response.
As an example, you can make a ping transaction that passes from the network straight down the stack to the database and there does a dummy select to read the ok from a dummy table and return that result. That allows you to (in contrast to a "normal ping" that tests only the network) have confidence that all layers in the application including the database are actually alive.
- Ping is one of the most basic and useful network commands. It sends request to networked computer and waits for response. It’s easy to ping single PC but it’s pain to ping dozens (or even hundreds) of them.
- The process of Pinging the entire Subnet which can have N nos of PCs are known as Deep Ping. Network scanners are usually used to do this....

Categories

Resources