devxlogo

We are an award-winning tech entrepreneurship website where trusted experts can provide value globally.

Since 1998, DevX has helped people start businesses, build websites, and provide enterprise technology to people globally. Interviewing the likes of Microsoft’s co-founder, Steve Ballmer, the publication brings comprehensive, reliable, and accessible insights to the Internet.

devxlogo

Trusted for 26 years

Over 30K Articles

1M+ Readers

Expert-reviewed

10K+ Tech Terms

As seen in:

microsoft logo
business_insider_logo
wired_logo
berkley
arstechnica_logo
hackernoon

The Latest

TROUBLESHOOTING TIMEOUT IN AWS ELASTIC BEANSTALK

There is a lot of similarities between detective stories (from Sherlock Holmes, James Bond,???) and troubleshooting production problems. Detective stories need to have a very complex/burning problem. If your application is experiencing issues in production, it automatically becomes a burning problem in the enterprise and gets attention from Senior Management. A detective uses very basic clues, extrapolates them, rules out the odd possibilities, puts a lot of hard work and identifies the villain. He fights against all odds, takes risks and eradicates the evil. A lot of heroism is involved. This is no way different from debugging/troubleshooting complex production problems. Thus I am going to introduce a fictional troubleshooting character: ???Jack Che???. Through this fictional character ??? I am going to narrate how complex real world production problems faced by major enterprises are solved. Feel free to share your comments and let me know whether you like it. If not I can always revert back to regular writing style. While twitter, Google and others are talking about 10 milliseconds, 20 milliseconds response time, still there are significant enterprises whose response time runs for several seconds. There is one such enterprise, whose response time was running for several seconds for their ???search??? transactions. Recently, this enterprise ported their application to AWS Elastic Beanstalk environment in Java 8/Tomcat 8. When a customer performs ???search??? operation on this application, a progress bar is displayed on the browser. Once search completes, progress bar vanishes and search results are displayed. After porting to AWS Elastic Beanstalk for certain data conditions, the customer was seeing a progress bar on the screen forever. Management didn???t know what was causing this issue and how to go about solving it. Thus they engaged Tier1app LLC to solve the problem. Tier1app LLC sent out their top notch troubleshooting detective ???Jack Che??? to solve the problem. HTTP 504 Gateway Time-out Error Code Just like every time, Jack Che was super excited to solve this problem. He assessed the situation quickly. He wanted to understand what interaction was going on between the Server and the browser. Thus he launched the developer console in the chrome browser and triggered the search transaction. A few seconds later, he saw HTTP 504 error code thrown from the server. (HTTP 504 is a time-out error thrown from the backend). Ah, he got his first clue. Now Jack Che started to review the Ajax javascript which made the backend server side call. Unfortunately, javascript didn???t have any error handling code in place. Thus, when error code was thrown it wasn???t handled and the screen was displaying progress bar forever. Wow, initial breakthrough for Jack Che within few minutes of his job. Seeing the smoke, where is the fire? Now Jack Che was curious to figure out from where this HTTP 504 error code is thrown? Jack Che found a second clue now; exactly at 60th second of the search transaction, this HTTP 504 error code was thrown. Since exactly at 60th second, HTTP 504 error code was thrown, Jack Che believed there is some sort of timeout is kicking in. But he wasn???t sure where this timeout value is configured. He searched all throughout the application source code to see whether any 60 seconds timeout is configured. He checked with the application development team. But there was no 60 seconds timeout configured anywhere within the application source code. Elastic Beanstalk Architecture Now he came to the conclusion that timeout is triggered by some component that is outside of the source code. Thus he started to examine each layer in the technology stack. Below is a very quick overview of the Elastic Beanstalk architecture.

Using a JDBC Template

Spring provides a nice abstraction on top of the JDBC API using JdbcTemplate and also provides great transaction management capabilities using annotation-based approach. By using the JdbcTemplate and NamedParameterjdbcTemplate classes,

Booter; Optional Parameter in SQL

Tip: Add an Optional Parameter in SQL

You may not know this, but you can have an optional Parameter in SQL. It took me forever to figure it out. In any case, you can implement an optional

Optional Parameters in SQL

You may not know this but you can have optional Parameters in SQL. It took me forever to figure it out. In any case, you can implement an optional parameter

Understanding the Time Taken to Execute a Task

There are situations when we need to understand the time taken for executing a section of code. We are also aware that System.currentTimeMillis() provides a good estimate of time. System.nanoTime()

List all Environment Variables

The system variables are exposed through the GetEnvironmentVariables method in the System.Environment class. var environmentVariables = System.Environment.GetEnvironmentVariables();foreach (var ev in environmentVariables){ DictionaryEntry de = (DictionaryEntry) ev; Console.WriteLine(string.Format(“Key: {0}, Value: {1}”,

Use the @RestController Annotation

It is a good idea to use @RestController (instead of simply @Controller), because it ensures you that it will return a Java Object rather than a reference to an HTML

Left, Right and Mid String Functions for C#

Unlike Visual Basic, C# doesn’t have built-in string methods to extract parts of string from the Left, Right or a location specified through Mid. Unfortunately you have to create the

Boostrapping Your Cloud Infrastructure

Managing large clusters of machines is non-trivial. Even in the cloud where the cloud provider takes care of a lot of the complicated stuff, such as networking, isolation and redundancy,

Variable Argument Method

The following class describes a method that can accept a variable argument instead of a fixed argument list. This can be handy where the developer is not sure of the

Turn on Line Numbers in SQL Developer

By default, line numbers are not turned on in SQL Developer. To turn them on, go to Tools ? Preferences: Click on the + next to Code Editor. Click on

Using the SQL LCASE Function

The LCASE() function simply converts the value of a field to lowercase. Syntax: SELECT LCASE(column_name) FROM table_name;

Performance Comparison: Apache vs. IIS

There has been a lot of discussion regarding which of the two most popular Web servers is better. In this article, we will try to compare their characteristics and performance.

Find Which Port Is Being Used by a Process

There are many instances when we struggle to find out which port is being used by our applications. On Windows, you can use the same netstat command, where the filtering

Enhancing the WebBrowser control–do not use

The Webbrowser control does not show the notifications of the document like  a) downloading web page.. b) resolving proxy…  c) hyperlink url’s  You can quickly enable this by using the StatusTextChanged Event of the webbrowser control. It is a two-step process:  Step 1: Attach an event handler to the Webbrowser’s StatusTextChanged event, Like myWebBrowser.StatusTextChanged += new EventHandler(myWebBrowser_StatusTextChanged);  Step 2: Use the Webbrowser’s StatusText property to retrieve the current status notification. Create the event handler. private  void myWebBrowser_StatusTextChanged(object sender, EventArgs e)  {    //get the current status text from the webbrowser control  //and assign it to a control in the status bar.      statusStrip1.Text = webBrowser1.StatusText;  }

Generate Random Passwords

Use the following method to generate random passwords. private string GenerateRandomPassword(int minLength, int maxLength) { StringBuilder randomPassword = new StringBuilder(); Random rand = new Random((int)DateTime.Now.Ticks); int randLength = rand.Next(minLength, maxLength);

New Features in ASP.NET Core

ASP.NET Core is the latest Web application development framework from Microsoft. It is a significant redesign of the legacy ASP.NET framework and has already become widely popular. ASP.NET Core is

Failing Test After Time Expired in Mockito

Failing test after expiring the set period of time in Mockito: @Timed(millis=2000)public void testTwoSecondTimeout(){ // some logic that should not take longer than 2 seconds to execute}

Method Overloading in C#

Method Overloading means that you can have different methods having the same code, but with different parameters. Here is an example: class MyMath{ public static int Add(int number1, int number2)

How to Undo Dropping a Table in Oracle SQL

Have you dropped a table by mistake and want to restore it? In some cases you can. Let’s say you’ve run this statement: DROP TABLE yourtable; Now, you want to

Cloud Platform Overview

In this article, I’ll introduce you to Cloud platforms, discuss the services they provide, the cost (not just monetary cost) and the problem of lock-in. I’ll also discuss hybrid systems

Displaying the Euro Sign in a Textbox

Don’t you just hate it that the Euro monetary symbol is not present on all computers? With this simple trick you can add the Euro sign to a textbox. Put

Check if an HttpRequest is an Ajax Request

A quick way to check if an HTTP Request is an Ajax request is by examining the X-Requested-With Header value. Please see below: bool isAjaxRequest = request.Headers[“X-Requested-With”] != null &&

Defining a Parameter in Jenkins

As you know, Jenkins accept parameters in different kind of projects, including pipelines. Depending on the operating system where Jenkins is running, we can refer to the parameters as follows,

Change the Output Format of a Date with TO_DATE

If you’re working with DATE fields in Oracle, and select this data, you’ll see the dates in the default output format. Depending on your location, the default date format could

Python 3.6 May be the Tipping Point

Python is a major programming language, eco-system and community. It is influential in numerous domains: scientific computing, Web applications, DevOps, education. It is being used extensively by prominent companies and

MySQL vs. MariaDB

Many developers have used MySQL, while they have only heard of MariaDB. Let’s explore the differences between these two database management systems. History MySQL and MariaDB share common history. MySQL

Introduction to WebSockets

In this article, I’ll introduce you the WebSocket technology using a sample application based on Socket.io. At the end of this article you will have a good idea what WebSockets