Individual pages in the system intermittently jump to the login page exception

Source: Internet
Author: User
Tags nginx server

First, the problem description

System name: In-company customer Relationship Management (CRM) system

System Architecture: The front-end is an nginx server as a load balancer, the backend for two Tomcat server to provide Web services, Nginx Server distribution request to hash IP address, to ensure that the same IP request is distributed to the same machine, so do not need to do session sharing.

The problem appears: the company system operation has been normal, one day, the system in the Business Management page request processing has not finished on the landing page to jump to the situation, the problem can be reproduced, other page request is normal.

Second, the analysis process

This kind of problem is better solved, because the other pages in the system request is normal, which provides a great help to troubleshoot the problem.

Page particularity: The first thought is that the page and other pages compared to the particularity, repeated observation of the page after the Dynamic Data volume, SQL execution time is longer (SQL has not been optimized), request processing time is longer (may reach a few seconds or even 10 seconds).

The possibility of jumping to the login page: The system to jump to the login page only two possible (the system error, after a few seconds to jump to the login page and the user is not logged in to jump to the landing page), it is easy to exclude the request error situation, that is, the user login is invalid.

How to Manage Login: The system checks the login is done in the filter, the user session management is not shared, the first reaction is the session out of the problem, suddenly think of nginx distribution request, the time of the request is controlled, relying on this to determine whether the back-end service is normal, If the backend request time-out does not return, the service is considered to be an exception, which in turn forwards the request to another machine. Such a thought makes sense, if the distribution to other machines, is definitely not logged in, this will definitely jump to the login page.

Third, solve the problem

Use Memcache to do session sharing, when users log in to query, record and update session information, user exit is to delete session information. Ensure that all back-end services share the session so that requests are forwarded immediately and no re-login is required.

Individual pages in the system intermittently jump to the login page exception

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.