Wednesday, 10 September 2014

Nginx Server interview Questions and Answers

Nginx Server interview Questions and Answers

What is Nginx Server?
Nginx is an open source web server and a reverse proxy server for HTTP, SMTP, POP3, and IMAP protocols with a strong focus on high concurrency, performance and low memory usage. It is pronounced as "engine x".


Who is Author of Nginx?
Igor Sysoev


In which Language Nginx is Written?
'C' Language


What is offical website of Nginx?
nginx.org


When Nginx's stable version launched?
5 August 2014


What is the Best Usage of Nginx Server?
Nginx can deploy dynamic HTTP content on a network with using of SCGI, FastCGI handlers for scripts, WSGI application servers or Phusion Passenger module. Nginx can also serve as a load balancer.


What is the Difference between Apache Web Server and Nginx?
Nginx uses an asynchronous event approach to handling multiple requests whereas Apache Web Server use the synchronous. Nginx's event-driven approach can provide more predictable performance under high loads.

Apache Web Server handling multiple request
|----A-----||-----B-----------||-------C------|

Nginx handling multiple request
 |----A-----|
    |-----B-----------|
        |-------C------|
In this way, Nginx is far better than Apache.



What are Features of Nginx?
  • Simultaneous Connections with low memory
  • Auto Indexing
  • Load Balancing
  • Reverse Proxy with Caching
  • Fault Tolerance



What are all feature of Nginx Server?

  • Ability to handle more than 10,000 simultaneous connections with a low memory.
  • Handling of static files, index files, and auto-indexing
  • Reverse proxy with caching
  • Load balancing with in-band health checks
  • Fault tolerance
  • TLS/SSL with SNI and OCSP stapling support, via OpenSSL.
  • FastCGI, SCGI, uWSGI support with caching
  • FastCGI via PHP (PHP-FPM) support with caching
  • Name- and IP address-based virtual servers
  • IPv6-compatible
  • SPDY protocol support
  • WebSockets and HTTP/1.1 Upgrade (101 Switching Protocols)
  • FLV and MP4 streaming
  • Web page access authentication
  • gzip compression and decompression
  • URL rewriting
  • Custom logging with on-the-fly gzip compression
  • Response rate and concurrent requests limiting
  • Server Side Includes
  • IP address-based Geo-Location
  • User tracking
  • WebDAV
  • XSLT data processing
  • Embedded Perl scripting
  • TLS/SSL support
  • STARTTLS support
  • SMTP, POP3, and IMAP proxy
  • Authentication using an external HTTP server
  • Upgrading executable and configuration without client connections loss and a module-based architecture.



What is the Master and Worker Processes in Nginx Server?
Master process read and evaluate configuration, and maintain worker processes.
Worker processes do actual processing of requests.


Where the Process ID does for Nginx Server? 
The process ID of the master process is written in the file /usr/local/nginx/logs/nginx.pid





What are the controls used in Nginx Server?
Nginx -s [stop | quit | reopen | reload]


What is the purpose of –s with Nginx Server?
-s parameter is used to run the executable file of nginx.


How to add Modules in Nginx Server?
Nginx modules must be selected during compile.
Run-time selection of modules is not supported by Nginx.


Friday, 5 September 2014

Mysql Interview Questions And Answers - Atomicity, Dedlock, Client Program, Mysql Mode, Mysql Sensitivity Of Identifiers And Mysql Errors

Question: what is the difference between where and having clause in mysql?
Answer:
where can restrict each row or record
having clause restrict group of records.



Question: What is Atomicity?
Answer:
This means whether execution of "all" statements or "no" statements.



Question: What is Deadlock?
Answer:
A failure or inability to proceed due to two transactions having some data that the other needs.



Question: What is mysql client program ?
Answer:
It is a command-line program that acts as a text-based front end for the MySQL Server. It's used for issuing queries and viewing the results in the terminal window.

mysql --help
mysql --version
mysql --V
In many cases, a given option has both a long and a short form. Long options consist of a word preceded by double dashes(e.g. --) whereas short options consist of a single letter preceded by a single dash(e.g. -).


Question: What is difference between Interactive Mode and Batch Mode of mysql client?
Answer: In Interactive modes, you put simple query to get the result, In this results is return in window.
In Batch Mode, you put your all the queries in sql file and run it from mysql client OR from scheduler job.  



Question: What is difference between \g and \G?
Answer: Both are the statement terminator alike semicolon(;). 

\g end the query statement and output the result in horizontal.
\G end the query statement and output the result in vertically and mainly used when output is large. 


Question: How to manage MySQL case sensitivity of identifiers?
Answer: Database name and table name are stored as file, So In window its case-insenstive and in unix it is case senstive.
Column name, index, and trigger are not case sensitive.
Column aliases are not case sensitive
 

Question: What is difference between identifier-quoting- character and string-quoting-character?
Answer:
backtick(`) are identifer quoting character and used  quote for dbname, tableName and filedName
Single Quote('), Double Quote(") are string quoting character

 

Question: What is SQL Query to print the warnings?
Answer: show warnings;


Question: What is SQL Query to print the warnings in Vertically?

Answer: show warning\G;display the warnings in vertical tabs;


Question: How to use limit in mysql warning?

Answer: show warning limit 1,2 \G;display the warnings in vertical tabs for 2nd & 3rd;



Question: In Mysql, How to disable the sql notes?
Answer: set sql_notes=0;



Question: How to get the detail of error in mysql?
Answer: perror 13; 
show the error message detail