Page 290 - DCAP312_WEB_TECHNOLOGIES_II
P. 290

Web Technologies-II



                   Notes         get into a queue and keep waiting until a worker thread is freed. This generally happens when
                                 site starts receiving much more hits than we originally planned. In that case, if we have CPU
                                 to spare, increase the worker threads count per process.
                                 maxIOThreads

                                 This is default to 20 per process. On a dual core computer, there will be 40 threads allocated
                                 for ASP.NET for I/O operations. This means at a time ASP.NET can process 40 I/O requests
                                 in parallel on a dual core server. I/O requests can be file read/write, database operations, web
                                 service calls, and HTTP requests generated from within the Web application and so on. So, we
                                 can set this to 100 if our server has enough system resource to do more of these I/O requests.
                                 Especially when our Web application downloads/uploads data, calls many external web services
                                 in parallel.
                                 minWorkerThreads

                                 When a number of free ASP.NET worker threads fall below this number, ASP.NET starts putting
                                 incoming requests into a queue. So, we can set this value to a low number in order to increase
                                 the number of concurrent requests. However, do not set this to a very low number because
                                 Web application code might need to do some background processing and parallel processing
                                 for which it will need some free worker threads.
                                 minIOThreads

                                 Same as minWorkerThreads but this is for the I/O threads. However, we can set this to a lower
                                 value than min Worker Threads because there is no issue of parallel processing in case of I/O
                                 threads.
                                 memoryLimit
                                 Specifies the maximum allowed memory size, as a percentage of total system memory, that the
                                 worker process can consume before ASP.NET launches a new process and reassigns existing
                                 requests.  If  we  have  only  our  Web  application  running  in  a  dedicated  box  and  there  is  no
                                 other process that needs RAM, we can set a high value like 80. However, if we have a leaky
                                 application that continuously leaks memory, then it is better to set it to a lower value so that
                                 the leaky process is recycled pretty soon before it becomes a memory hog and thus keep our
                                 site healthy. Especially when we are using.




                                              Reduce the size of downloads


                                   The problem
                                   WebPagetest is accounting for 1,425KB of data transferred. That is quite a lot.
                                   The worst offender in GitHub’s case seems to be the Gravatar 3rd party service. Gravatar
                                   is a popular service that allows showing a personal avatar for users of the interweb based
                                   on their e-mail address. In the case of that GitHub page, Gravatar is loading 34 images for
                                   a total of 500KB. That is more than a third of the payload.
                                   The second worst offender is the host called camo.githubapp.com. It seems to be serving
                                   2 images in our example. At first, was a bit puzzled about that host as I could not quite
                                   figure out why GitHub was serving directly 2 images worth 500KB (that is another third
                                   of our total payload) instead of using their CDN. After a bit of research I found the Camo
                                   project. GitHub is enforcing SSL for every page. When GitHub users write comments and
                                                                                                      Contd...



        284                               LOVELY PROFESSIONAL UNIVERSITY
   285   286   287   288   289   290   291   292   293   294