Average Cpu URI Uses Maximum CPU Amount

Hello, I am using a servlet that contains a save manager object with two objects, and when I use it in the control panel, I have this message:

"This URI uses a high processor speed and may soon exceed its quota."

I have 2300 for avg cpu for this uri, why is it taking so long?

When I look at the log at the beginning, I have a high processor speed, like 2000, and after I have less than 200, why?

And after 10 minutes, when I return, I again have the number of processors, why?

Is it possible to reduce this time?

Edit: code

public void doGet (HttpServletRequest req, HttpServletResponse resp) throws an IOException {

    String param1 = req.getParameter("param1");
    String param2 = req.getParameter("param2");

    PersistenceManager pm = PMF.get().getPersistenceManager();
    String query = "select from " + Myclass.class.getName()+
    "where parameter1 == param1 && parameter2 == param2 "+
    "parameters String param1, String param2";

List<Myclass> result = (List<Myclass>) pm.newQuery(query).execute(param1, param2);

    if(result.isEmpty()) {
        pm.close();
        resp.sendRedirect("/welcome.jsp");
    }
    else {
        pm.close();
        resp.sendRedirect("/question.jsp");
    }
}
+3
1

- Google.

google , , - . , .

, , -

  • [ ] cron HTTP- . , , , .

, :

+3

Source: https://habr.com/ru/post/1760543/


All Articles