-2

I use this code for refresh my asp.net page:

<script src="jquery-2.1.1.min.js"></script>
<script type="text/javascript">
    $(document).ready(function () {
        setTimeout("RefreshPage()", 500);

    })
    function RefreshPage() {
        location.reload();
    }

</script>

my question is:

Every 500ms server get a request we assume my web page have 1000 users and 1000 users use this code for auto resfresh web form page,do my server is down or crash?

for example reload web page every 2000ms

my server properties:

cpu:2.5GHZ Dou Ram:4GB Hard:50GB

  • 2
    What for do you reload the page every 500ms? There could be alternative approach for your issue. – naota Jul 12 '14 at 13:12

2 Answers2

0

I understand your question to be:

Is refreshing from the server at an estimated 2000 requests per second going to take my server to its knees and cause performance or stability issues?

The answer is that it completely depends...

It depends on

  • what the request looks like (somewhat)
  • how much processing is required on the server to create the response
  • what the response looks like

If I were in this situation I would run some load testing on the server to see if 2000 rps is feasible

Try using wcat to do the load testing

See also: Stress Testing ASP.Net application

Community
  • 1
  • 1
MikeM
  • 27,227
  • 4
  • 64
  • 80
0

Why will you call the server every 500 milliseconds. Are you doing a stress test of the server?

Otherwise, it is a very bad practice. If you are new to the refreshing technique. then please read it below.

It is always a best idea to not to call to the server when it is not required and especially when there is a big data involve.

Thus, my suggestion would be is to implement the following:

AJAX call that uses Cachecow and ETAG technology at server side.

The way you will follow this pattern:

  1. Client send a new request
  2. Server send a ETAG (hash of web page).

On refresh

  1. Client send a new request with the ETAG
  2. Server checks if ETAG (has of web page) is different than what it will be evaluated from the new content.
  3. If the contents are not changed then there is no response back to the client, thus you don't need to worry about big load at client or server side.

If contents are changed then the response goes with the new ETAG.

For more details please refer: http://www.infoq.com/articles/etags

codebased
  • 6,945
  • 9
  • 50
  • 84