We are providing online training of realtime Live project on Asp.Net MVC with Angular and Web API. For more information click here. If you have any query then drop the messase in CONTACT FORM

Monday, June 29, 2015

Web application maintenance related ASP.NET Interview Questions

What are the 3 major steps involved in maintaining a deployed web application?

1. Monitoring the application for error, performance, and security issues.
2. Repairing the application as issues are discovered.
3. Tuning the application to respond to user traffic.

What is the MMC snap-ins provided by windows for monitoring security, performance, and error events?
The Event Viewer snap-in: Lists application, system, and security events as they occur on the system. Use this tool to see what is currently happening on the server and to get specific information about a particular event.


The Performance snap-in: We create new events to display in the Event Viewer and allows us to track event counters over time for display graphically or in report form.


How do you run the Event Viewer to view application, system, and security events as they happen?
To run the Event Viewer, choose Event Viewer from the Administrative Tools submenu on the Windows Start menu. (We can show the Administrative Tools menu in Windows XP Professional by opening the Start button’s Properties dialog box and clicking the Customize button on the Start Menu tab. The Administrative Tools option is located on the Advanced tab of the Customize Start Menu dialog box.) After clicking the Event Viewer shortcut, Windows displays the Event Viewer snap-in in the MMC.

What are the 3 levels at which the Event Viewer snap-in displays general application, system, and security events?
1. Informational events.
2. Warning events.
3. Error events.

Can you repair a deployed web application in place without restarting the server or IIS?
Yes, to repair a deployed Web application, copy the new assembly (.dll) and/or content files (.aspx, .ascx, and so on) to the application folder on the server. ASP.NET automatically restarts the application when we replace the assembly. We do not need to install or register the assembly on the server.

What is ASP.NET Process recycling?
Process recycling is the technique of shutting down and restarting an ASP.NET worker process (aspnet_wp.exe) that has become inactive or is consuming excessive resources. We can control how ASP.NET processes are recycled through attributes in the processModel element in the Machine.config file.

Describes the processModel attributes found in machine.config that relates to processing recycling?
1. timeout attribute: The amount of time (hh:mm:ss) before the process is shut down and restarted. Use this setting to automatically recycle a process after a certain number of requests as a preventive measure.


2. shutdown timeout attribute: How much time each process has to shut itself down. After this amount of time, the process is terminated by the system if it still running.


3. request limit attribute: The number of queued requests to serve before the process is shut down and restarted. Use this setting the same way we use the timeout attribute.


4. restartQueueLimit attribute: The number of queued requests to retain while the process is shut down and restarted.


5. memoryLimit attribute : The percentage of physical memory the ASP.NET process is allowed to consume before that process is shut down and a new process is started. This setting helps prevent memory leaks from degrading the server.


6. responseRestart­ - DeadlockInterval : The amount of time to wait before restarting a process that was shut down because it was deadlocked. This setting is usually several minutes to prevent applications with serious errors from degrading the server.


7. responseDeadlockInterval : The amount of time to wait before restarting a process that is deadlocked. The process is restarted if there are queued requests and the process has not responded within this time limit.

What is the use of processModel element apart from providing process recycling?
The processModel element in the server’s Machine.config file provides attributes that control certain performance aspects, such as
1. The maximum number of requests to be queued.
2. How long to wait before checking whether a client is connected.
3. How many threads to allow per processor.

Describe the processModel attributes that relate to performance tuning?
requestQueueLimit 
The number of queued requests allowed before ASP.NET returns response code 503 (Server too busy) to new requests
clientConnectedCheck 
The amount of time (hh:mm:ss) to wait before checking whether a client is still connected
maxWorkerThreads 
The maximum number of threads per processor
maxIOThreads 
The maximum number of I/O threads per processor

In general, lowering these settings allows our server to handle fewer clients more quickly. Increasing these settings permits more clients and more queued requests, but slows response times.

How do you turn off Session state?
To turn off Session state, in the application’s Web.config file, set the sessionState element’s mode attribute to Off.

If you turn off Session State, can you use Session state variables in code anywhere in the application?
No

What is Optimization?
Optimization usually refers to writing code in a way that executes more quickly or consumes fewer resources. In general, optimizations simply reflect good programming practices.

List some of the common steps to follow to optimize a web application for performance?
Turn off debugging for deployed applications.
Code that has been compiled with release options runs faster than code compiled with debug options.


Avoid round-trips between the client and the server.
ASP.NET uses postbacks to process server events on a page. Try to design Web forms so that the data on the Web form is complete before the user posts the data to the server. We can use the validation controls to ensure that data is complete on the client side before the page is submitted.


Turn off Session state if it isn’t needed.
In some cases, we can design our code to use other techniques, such as cookies, to store client data.


Turn off ViewState for server controls that do not need to retain their values.
Saving ViewState information adds to the amount of data that must be transmitted back to the server with each request.


Use stored procedures with databases.
Stored procedures execute more quickly than ad hoc queries.


Use SqlDataReader rather than data sets for read-forward data retrieval.
Using SqlDataReader is faster and consumes less memory than creating a data set.

No comments: