Home » Magento tutorial for developer » Guide on debugging Magento webpage network problems

Guide on debugging Magento webpage network problems

Today , we will go through how to debug Magento webpage network problems

While using external resource connection within Magento webpage, you may face partial or total server unavailability with the consequences of poor Magento webpage functionality. Let us take a common case of the overloaded/unavailable licensing server leading to a probable error extension license check-in. There are two major scenarios of upcoming event progress with either execution delay or a bunch of errors/unpredictable webpage behavior, which surely won’t speak for Magento store profitability. What we’re driving at is that in case of your Magento webpage crush, there’s a point in investigating if it has anything to do with external resource unavailability.

The following guide by Amasty is pumped up for the Magento-page superuser with privileged access and looks into the ways to fix any poor website behavior caused by the reason mentioned above.

Firewall Connection Log-in

In order to figure out whether the server has trouble while connecting to external resources, choose the option of tracing it by logging in the firewall. In case of multiple external connections, apply the following rule in the end of OUTPUT chain to activate all of the resources under consideration:

A new connection is easy to find out with the log containing the undermentioned syslog records (usually /var/log/messages or /var/log/syslog):

There is also an option of limiting the list of services providing multiple outbound connections. Such action demands inputting user’s UID, which is liable for PHP interpreter launch. The usual entries are the following:

  • Apache (UID: 99)
  • www-data (UID: 33)
  • files owner (UID can be learnt by the command id -u username).

If the server is Debian/Ubuntu-based, the undermentioned rule is applied:

Interpreter Process Trace

Tracing PHP interpreter process will provide you with a profound insight into the matters of More request performance behavior. In order to get the information, use tracing utility strace. If your server isn’t stuffed with one, install it through package manager or compile it on your own, following the instruction code:

To get the performance tracing launched, you need to add instruction sleep (60) in the beginning of the root file index.php;

Such an action will spare you one minute of delay execution to catch the required process and attach strace to it. The mission of strace attachment will be completed with PID (Process ID), which you will know through either referring to mod_status http://your-site-name/server-status) or by checking out in the processes list; “12345” at the end of the following rule indicates your PID (Process ID) to be attached.

Upon the request completed, close down strace execution by pressing CTRL+C buttons and check log file /tmp/strace.log. The log will contain all the system calls performed by the interpreter while executing the request. Parameter «–e» marks the choice of call class (the example embodies logged calls connected to the network operations only). In order to get the list of all the calls, exclude the undermentioned parameter.

The former example shows DNS request to server and then connection attempt to the host with port 25/tcp, ending up with an error (ECONNREFUSED).

Hope you’ve found our guide useful. And remember to check error logs (usual web server logs: /var/log/httpd/error_log in RHEL/CentOS and /var/log/apache2/error_log in Debian/Ubuntu), regardless of the debugging method under your belt.

About Brian Wilson

Brian is a freelance Magento developer with 5 years of experience with customizing Magento extensions, magento themes. He's interested in sharing Magento Tutorials to the community

Leave a Reply

Your email address will not be published. Required fields are marked *


You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">

Scroll To Top