The load-on-startup is the sub attribute of servlet attribute in web.xml. It is used to control when the web server loads the servlet. As we discussed that servlet is loaded at the time of first request. In this case response time is increased for first request. If load-on-startup is specified for a servlet in web.xml then this servlet will be loaded when the server starts. So the response time will not increase for fist request.
Any positive or negative value can be passed in the load-on-startup. If positive value is passed then all servlets having load-on-startup sub attribute will be loaded when server starts but a servlet having low positive value will be loaded first. In case of negative value servlet will be loaded at the time of first request.
In the above example Servlet1 and Servlet2 will be loaded when server starts because positive value is passed in there load-on-startup. Servlet3 will be loaded at the time of first request because negative value is passed in there load-on-startup.