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.
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 6 years ago.
Improve this question
i wish to add a functionality to my website that is to send a pop up message which i've typed, to all online users . i am able to get user id's of all online users. how could i send message in a jquery pop up to all users. Any one please give me an idea..
The solution to this requires 3 components:
First you need to make sure that whatever is typed is sent to the server. The easiest way is just via an Ajax call whenever you're done typing (or hit a button)
Secondly, you'll have to store the message(s) on the server including what users you've already distributed the message to. This can be just in memory on the server or in a database or file.
Lastly, each of the participating users will have to have a mechanism for retrieving the messages. The easiest way is just to have an Ajax call every 10 seconds for instance which asks the server if there are new messages. If there are they are returned and displayed in a popup.
The server can then mark the message as being sent to that user as well as keep a list of users that are active.
Note both the Ajax communications could be replaced with websocket connections if you want ultimate performance, but they are somewhat harder to set up, so I'd only recommend that if you have many users or many messages.
You can simply write an asynchronous script, that runs in the background, requesting from an API, and if it gets some valid response from API, you can popover a message via jQuery!
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
I am working on a distributed system project. I am required to create a program that allow multiple users to edit on the same text file concurrently. I have been looking around online for a relatively simple solution but I haven't found one. I've read about BlockingQueue but that doesn't make much sense to me. I have talked to my TA and he suggested that each client will have a copy of the text file, which will they edit. Those sub-files will then be merged to the main copy. However, the problem is that I won't be able to update those sub-files while they are editing the text file.
As I understand it you want an online text editor with which you can modify files concurrently and the updates should happen as real-time as possible.
Here is what I would do:
If a user opens a file he receives a copy of it and the user is added to the list of users which have opened this file.
After a user makes a change, wait X seconds to accumulate further changes and then send them to the server.
The server processes the change requests for a file one after the other (different files can be done in parallel of course and it can also be done more intelligently by splitting files into chunks which can be processed independently in parallel too, at least on the server side [this is only partially true, two changes can be processed in parallel if the intersection of the set of affected chunks in change A and change B is empty])
A change request is either acceppted and all the changes are broadcastest to all user that have the file opened or the change is refused. This can be pretty complicated. The easiest way is to keep track with a version number and refuse all changes that come from older versions. (If you have a version number for each chunk and the size of the chunks is small, you will only run into rejections if two or more people are working at the almost same location in a document at the same time. But it will be quite some work, consider you will have to split/merge/delete/insert chunks if they become too big or small.)
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'm creating an app wherein the database are uploaded online without website, the concept of the app is like Waze app. I dont know where to start im asking for ideas and help. do i need to create a web server?how?i will mark this correct for those who can answer thanks.
This is not a simple task because it relies on many parts doing its proper job... In order to do what you want to do you need basically 5 things:
1.- Server: which will feed live information to the app.(There is a ton of servers that can be used to get this part done. If you are used to, or willing to learn php, I suggest you to start researching XAMPP (it uses Apache server running php stuff) [https://www.apachefriends.org/es/index.html]).
2.- Database: Most likely the server will need to work with information stored in some place. databases are perfect for just that. XAMPP also comes with MySQL which happens to be the most popular open source database out there.
3.- Format :You need to determine how the information will be passed from the server to the mobile device. The most common ways are: JSON which is plain text, XML that also is plain text but formatted diferently. this is important because you have to send the information from the server using this format and also your mobile devices will need to interpret the information in this format.
4.- Choose a way to send and recive the information : i would suggest Http/Ip protocol for this, as it is very common. Investigate Http requests and responses.
5.- Your device must be listening (or asking) for the content : the device will have to implement some sort of timer to ask the server for new information. This is determined by the logic and prupose of what you wish to do.
do i need to create a web server?
Yes! You need to create a web server, then, a webservice (database query etc...) which communicate between your application and your webserver. I think that all!
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
for my new project I need to write server-side application that will serve some of simple requests. I have no experience of writing server-side application, so I need some advice.
The problem is that I don't know how to start; I've spent couple of hours searching google for some guidelines, but I got nowhere.
I need to write application that will ran on the server (I've installed Ubuntu server in VirtualBox and used briged connection, so I can access it from my network) and will serve some requests:
connnect to server
authorize user (check user and his pass in db)
store some data in db on connection (for example IP address)
I am not sure which language would be best to use and what do I need to know to implement that app. This is my private project, which I came up with to learn something new; until now I have always written apps that ran locally (usually in Java/C/Python).
I've seen some tutorials on PHP and Django, but I am not sure if I am going in the right direction.
Thanks in advance for all help :)
I would prefer to you meteorjs look at www.meteor.com the reason why im prefering this to you is that i was in the same position as you one month ago and i,m amaized with meteorjs. Also have a look at derbyjs. This frameworks are built on top of node.js it allows you to write only javascript end to end.
Look at install.meteor.com you will find a quick install bash file.
At the end you can do this with any of the languages you mentioned. Write with what you like the most.
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.