Connection pooling is a technique used to avoid the overhead making of new database connection every time. An application or server object requires access to a database. This technique of “pooling” connections is based on the fact that most applications only need a thread to have access JDBC connection when they are actively processing a transaction, which usually take only milliseconds to complete. While not processing a transaction, the connection would otherwise sit idle. Instead, connection pooling allows the idle connection to be used by some other thread to-do his useful work.
Connection pooling enables the ODBC driver to re-use existing connections to a given database from a pool of connections, instead of opening a new connection each time the database is accessed. By enabling connection pooling you can improve the overall performance of your application by lowering the time taken to open a connection to a database in the connection pool.
When a thread needs to do work against a MySQL or other database with JDBC, it requests a connection from the pool. When the thread is finished using the connection, it returns it to the pool, so that it can be used by any other threads. The overhead time for establishing a database connection is typically around 1 to 3 seconds. This is the time it takes to locate the database server to establish communication channel and exchange information. Sun has standardized the concept of connection pooling in JDBC through the JDBC-2.0 “Optional” interfaces, and all major application servers have implementations of these APIs that work fine with MySQL Connector.
Load balancing is a technique to distribute work between two or more servers, network links, CPUs, hard drives, or other resources in order to get optimal resource utilization, maximize output, and reduce response time. These days this techniques is being used extensively for web application to provide better experience to user.
In Web load balancing is the process by which inbound internet protocol (IP) traffic can be distributed across multiple servers to enhance the performance of the servers, leads to their optimal utilization and ensures that no single server is overwhelmed. Load balancing is specifically vital for busy networks (with huge traffic), where it is difficult to approximate the number of requests that will be issued to a server. Two or more web serves are employed in a load balancing scheme. If one of the servers begins to get overloaded, the requests are forwarded to another server. Service time is reduced by using a load balancer to identify which server has the appropriate availability to receive the traffic.
The process is vary simple and straightforward. A user’s request for a webpage request is sent to the load balancer, which forwards the request to one of the servers. That server responds back to the load balancer, which in turn sends the response on to the end user.
Load balancing keeps the application/service alive even in the face of server down time due to server failure or maintenance. If you are load balancing across several servers and one of the servers fails, your service will still be available to your users, as the traffic will be diverted to the other servers in your server farm.
There are several types of load balancing techniques.
Round Robin DNS Load Balancing: The in-built round-robin feature of BIND of a DNS server can be used to load balance multiple web servers.
Hardware Load Balancing: Hardware load balancers can route TCP/IP packets to various servers in a cluster.
Software Load Balancing: Most commonly used load balancers are software based, and often comes as an integrated component of expensive web server and application server software packages.
FFmpeg is a wonderful library for creating video applications or even general purpose utilities. FFmpeg takes care of all the hard work of video processing by doing all the decoding, encoding, muxing and demuxing for you. This can make media applications much simpler to write. It’s simple, written in C, fast, and can decode almost any codec you’ll find in use today, as well as encode several other formats.
FFmpeg is a very fast video and audio converter. It can also grab from a live audio/video source. It can also convert from any sample rate to any other, and resize video on the fly with a high quality polyphase filter. FFmpeg is basically a computer program that can record, convert and stream digital audio and video in numerous formats. It is a command line tool that is composed of a collection of free software / open source libraries. It includes libavcodec, an audio/video codec library used by several other projects, and libavformat, an audio/video container mux and demux library. The name of the project comes from the MPEG video standards group, together with “FF” for “fast forward”.
An Insight
FFmpeg is developed under Linux, but it can be compiled under most operating systems, including Apple Inc. Mac OS X, Microsoft Windows and AmigaOS. The command line interface is designed to be intuitive, in the sense that FFmpeg tries to figure out all parameters that can possibly be derived automatically. You usually only have to specify the target bitrate you want.
The generic syntax is: ffmpeg [[infile options][`-i’ infile]]… {[outfile options] outfile}…
The project is made of several components:
ffmpeg is a command line tool to convert one video file format to another. It can also grab and encode in real time from a TV card.
ffserver is an HTTP and RTSP multimedia streaming server for live broadcasts. It can also time shift live broadcast.
ffplay is a simple media player based on SDL and on the FFmpeg libraries.
libavcodec is a library containing all the FFmpeg audio/video encoders and decoders. Most codecs were developed from scratch to ensure best performance and high code reusability.
libavformat is a library containing demuxers and muxers for audio/video container formats.
libavutil is a helper library containing routines common to different parts of FFmpeg. This library include adler32, crc, md5, sha1, lzo decompressor, Base64 encoder/decoder, des encrypter/decrypter, rc4 encrypter/decrypter and aes encrypter/decrypter.
libpostproc is a library containing video postprocessing routines.
libswscale is a library containing video image scaling routines.
libavfilter is the substitute for vhook which allows the video to be modified or examined between the decoder and the encoder.
Major use over the Internet:
FFmpeg Hosting or ffmpeg webhosting is special hosting for online video sharing web sites. FFmpeg converts video to .flv format or any other video format. With FFmpeg web hosting you can create powerful online video sharing web sites just like YouTube. FFmpeg is used by many open source projects, including VLC, MPlayer, Handbrake, Google Chrome.
Does not ensure bitrate consistency accross a set of files. So a set of AVI files produced from a set of VOB files cannot be merged into a single AVI.
The latest version available at Sourceforge (strangely) predates the version bundled with gui4ffmpeg. Currently the version available on Sourceforge does not support the “-vtag xvid” option. So users are stuck with Windows if they want to run the latest.
According to rumor, the codec does not accurately compress at the bitrate requested by the user.
All of you must have heard about web feeds and RSS but many of you might not aware that exactly what these terms mean. Simply put, a web feed is a data format used to syndicate (or distribute) your website’s content, allowing users to subscribe to these content updates. Web feeds allows subscribers to be aware of any addition/update of content or articles on your website without actually visiting the website check the updates. This is the same concept as subscribing to a newsletter. News websites and blogs are common sources of webfeeds.
Web feeds are often XML based documents and RSS (Really Simple Syndication or Rich Site Summary) is one of the most commonly used formats of web feeds. Another format called Atom format is a bit outdated nowadays. There are three main components involved in web feed subscription mechanism -
Feed: The article or content which has been added on the website
Feed Generator: Software which generates feeds. A typical website needs RSS feed generator software integrated in it where as a Wordpress Blog has a built in RSS feed generator. An Orange web feed icon in the address bar indicates that web feeds are available for subscription.
Feed Reader: Also known Feed Aggregator, this is a program which allows users to view feed. It is the feed reader which checks and ‘pulls’ the feed rather than feed generator ‘pushing’ the feed into the reader.
One of the most common forms of subscribing to RSS feeds is by Live Bookmarks. To use these, just click on the orange feed icon address bar of your browser and choose Live Bookmarks from the drop down menu. This will palce dynamic bookmark in Bookmarks Menu of your web browser, containing links to latest feeds. These links will keep on updating as new posts are added and old links disappear from live bookmarks. If you are using Mozilla Firefox, check ‘Bookmarks Toolbar’ in your bookmarks menu to view the recently subscribed feeds.
Apart from live bookmarks, you can also subscribe to webfeeds by websites such as iGoogle, MyYahoo, Google Reader or Bloglines. All you have to do is select Google (or Yahoo) from the drop down menu after you have clicked on feed button. Then, select Add To Google HomePage or Add To Google Reader. A gadget containing feeds from the website will appear on you iGoogle page if you select the former.
Though web feeds have similarity with email newsletters, they have certain advantages which make them preferred method of subscription. First, you don’t have to share your email id, thus reducing the risk of spam and virus attack. Secondly, rather than sending an “unsubscribe” request, you can simply remove the feed. All these features make RSS and webs feeds most popular technique of syndicating website content. So don’t forget to subscribe to feeds for our RedAlkemi Blogosphere to keep you updated with latest informative articles.
There are many real world programming models where we must use threads. They are used when we have to do a lot of simultaneous processing, whether it is a web server processing a large number of user requests or a desktop application processing a lot of URLs to fetch and process their content.
In any of the above scenarios, we generally need a thread-per-request model, but the biggest disadvantage of this approach is the overhead of creating and destroying threads and active threads consume system resources. This approach will make a situation where the application would consume more time and system resources in creating and destroying thread objects rather than processing actual tasks.
Thread Pools come to rescue from these situations. While working with thread pools we get the following benefits that solve our problems to a large extent:
1. By reusing threads, the overhead of creating and destroying threads is reduced.
2. Small number of threads consume less amount of system resources especially memory, so JVM will not give frequent out of memory errors.
3. Requests are served faster because the delay caused in creating new threads-per-request is negligible.
4. Huge amount of requests can be processed in less amount of time and by consuming less amount of system resources.
Thread pools help us to process more number of tasks in a parallel way and by using the system resources in controlled manner.