Jaslabs: High performance Software

High Performance Software

Archive for February, 2006

using vmware for development

By Justin Silverton

As a programmer, I often times need to develop or test my work on multiple operating systems such as linux, freebsd, and various versions of windows. Rather than keep separate boxes around for each operating system, I run windows 2003 standard edition as my base OS and a vmware session for each separate OS.

My current hardware is : amd64 with an 80 gig harddrive/1 gig of Ram. Any OS that I have tried runs very fast, with almost no noticable difference from a regular installation.

One quick tip: install the Vmware tools. This will improve performance significantly.

One of the most interesting features of Vmware is the fact that it has bridged networking. This allows your sessions to each have their own separate IP addresses on your network. This can really come in handy if you want to test out a new server on linux or an apache installation.

Beyond development, vmware can also be used to surf the Internet without having to worry about your computer getting infected with spyware. This may be overkill, but it just might save you from having to re-install your entire OS because of an insecure browser.

Vmware has a free verson available for both windows and linux. It is in beta, but it still works very well for most people’s needs.

Both can be downloaded Here

Share and Enjoy: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Digg
  • del.icio.us
  • DZone
  • Slashdot
  • StumbleUpon
  • Technorati
No comments

using sql relay

By Justin Silverton

What is SQL relay?

SQL Relay is a persistent database connection pooling, proxying and load balancing system for Unix and Linux supporting ODBC, Oracle, MySQL, mSQL, PostgreSQL, Sybase, MS SQL Server, IBM DB2, Interbase, SQLite and MS Access (minimally) with APIs for C, C++, Perl, Perl-DBD, Python, Python-DB, Zope, PHP, Ruby, Ruby-DBD, Java and TCL, drop-in replacement libraries for MySQL and PostgreSQL clients, command line clients, a GUI configuration tool and extensive documentation. The APIs support advanced database operations such as bind variables, multi-row fetches, client-side result set caching and suspended transactions. It is ideal for speeding up database-driven web-based applications, accessing databases from unsupported platforms, migrating between databases, distributing access to replicated databases and throttling database access.

SQL Relay is ideal for:

  • speeding up database-driven web-based applications
  • enhancing the scalability of database-driven web-based applications
  • distributing access to replicated databases
  • throttling database access
  • accessing databases from unsupported platforms
  • migrating applications from one database to another

SQL Relay supports the following database backends:

  • Oracle
  • MySQL
  • mSQL
  • PostgreSQL
  • Sybase
  • MS SQL Server
  • IBM DB2
  • Interbase
  • Sybase
  • SQLite
  • ODBC
  • MS Access

The SQL Relay client API’s support advanced database operations such as bind variables, multi-row fetches, client-side result set caching and suspended transactions. SQL Relay has native client API’s for the following languages:

  • C
  • C++
  • Perl
  • Python
  • PHP
  • Ruby
  • Java
  • TCL
  • Zope

How does SQL Relay work?

SQL Relay’s connection daemons log into and maintain sessions with databases. These connection daemons advertise themselves with a listener daemon which listens on an inet and/or unix port for client connections. When a client connects to the listener, if a connection daemon is available, the listener hands off the client to that connection. If no connection daemon is available, the client must wait in queue until one is. Once a client is handed off to a connection daemon, the client communicates to the database through the session maintained by that daemon.

How can SQL Relay improve the efficiency of my website?

Here are some examples of how SQL Relay can improve the efficiency of your web site.

Let’s say you’re running CGI’s againt a transactional database such as PostgreSQL, MS SQL Server or Oracle. CGI’s have to log into and out of the database each time they run. If you use SQL Relay to maintain persistent connections to the database and just log into and out of SQL Relay, you can reduce the amount of time wasted establishing database connections and handle more CGI requests per-second. This is both because the time-cost of connecting to SQL Relay is smaller than the time-cost of connecting to a transactional database, and because the SQL Relay client library is smaller than most database client libraries, resulting in a more lightweight CGI.

Let’s say you’re using Apache, PHP and Oracle and you determine by doing all sorts of analysis that you need to keep 30 Apache processes running to provide adequate response. Since most of your site isn’t database-driven, on average, no more than 5 PHP’s actually access the database simultaneously. Currently, you’re using persistent connections to defeat the time-cost of logging into Oracle, but you have to maintain 30 connections (1 per web server process) which takes up a lot of memory on both the web server and database server and you really only need 5 connections. By using SQL Relay you can reduce the number of Oracle connections to the 5 that you need, continue to run 30 Apache processes and reclaim the wasted memory on both machines.

Many websites run a combination of PHP’s and Perl modules. Perl modules can use Apache::DBI and PHP’s have a persistent database connection system, but a PHP cannot use an Apache::DBI connection and a Perl module cannot use a PHP persistent connection. Thus in order to make sure that there are enough database connections for each platform, many more web-server processes have to be run, perhaps twice as many. If the PHP’s and Perl modules used SQL Relay instead, they could share databse connections and reduce the number of web-server processes and database connections.

SQL Relay makes it easy to distribute load over replicated servers. A common scaling solution when using MySQL or PostgreSQL in a read-only web environment is to run several web servers with a dedicated database server for each web server or group of web servers and update all the databases simultaneously at scheduled intervals. This usually works pretty well, but sometimes database or web servers get runs of heavy load while others are idle. In other cases, an uneven number of machines is required. For example, your application may need 3 web servers but only 2 database servers or vice-versa. People usually just by 3 of each, wasting money. Moreover, in most cases, the servers have to be equivalently powerful machines. You can’t usually just add another cheap machine that you have lying around into the pool. SQL Relay can connect to multiple, replicated or clustered database servers, providing web-based applications access to whichever server isn’t busy. SQL Relay can also be configured to maintain more connections to more powerful machines and fewer connections to less powerful machines, enabling unevenly matched machines to be used in the same database pool. Collectively, these features allow you to save money by using only the exact number of servers that you need and by enabling you to use spare hardware in your database pools.

Where can I get it?

SQL relay can be downloaded Here

 

Share and Enjoy: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Digg
  • del.icio.us
  • DZone
  • Slashdot
  • StumbleUpon
  • Technorati
1 comment

why use php5?

By Justin Silverton

New Object-orientated features

In the previous versions of PHP, objects and classes were supported, but only on a limited basis. Missing was the ability to de-reference objects that are returned from a method and implicit object cloning resulted in unexpected behavior.

The following are new features within php5

A) Public, private, protected class modifiers

These modifiers may be used on both properties and methods, and restrict access.

B) Interfaces and abstract classes and methods.

C) Object cloning

The scripting engine never automatically clones objects in PHP 5, whether they are assigned, passed by-value, or returned by-value. If you do need to clone an object, then you can use the following syntax: “clone $newobject” or a method called __clone() can be implemented, which will be called after an object’s properties has been cloned.

 

D) Design Patterns

Supported in PHP 4, but now has new and improved features such as static properties and methods, private/public/protected modifiers, and interfaces.

E) XML and Soap

The soap protocol is becoming increasingly popular for communicating with web services. Many companies are implementing it to allow for easy access to data.

Improved mysql functionality

A new library, called mysqli, offers the following improvements over the old library:

A) SSL connectivity
B) prepared statements
C) Bound Input and Out parameters
D) Object orientated interface

Exception Handling

Exceptions allow you to have a greater degree of control over error handling, by separating the program logic. You no longer have to check the return value from a function.

Complete function list can be found here

Share and Enjoy: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Digg
  • del.icio.us
  • DZone
  • Slashdot
  • StumbleUpon
  • Technorati
No comments

another article on oracle/mysql

“In November, I looked at Oracle’s purchase of InnoDB, as well as their release of Oracle Express, and the effect on MySQL. In short, I concluded that the positives for Oracle were clear, but that MySQL must be feeling outmaneuvered. Since InnoDB, with its full transactional capability, has become an integral part of their product offering, I suggested that both BerkleyDB (their first transactional storage engine, but which has never got beyond so-called gamma status) and MaxDB (what was SAPDB, which is a fully-featured database but does not yet integrate well with MySQL’s other products) had both become critically important.
Shortly after Oracle purchased InnoDB, MySQL vice-president Richard Mason acknowledged that MySQL were “evaluating options to replace that functionality in some way,” but that they were “not at the point yet where we can go public with what that plan is but we will be shortly.”
However, since then Oracle has upped the ante even more. On February 14th, Oracle purchased Sleepycat Software, who provides MySQL with the Berkeley DB transactional storage engine. Furthermore, in the last few days, rumors have been flying that Oracle also intends to purchase both Zend (’the PHP Company’), as well as JBoss. I believe this is another smart series of moves by Oracle that can only benefit them……”


The rest can be found Here

Share and Enjoy: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Digg
  • del.icio.us
  • DZone
  • Slashdot
  • StumbleUpon
  • Technorati
No comments

Oracle and open source

By Justin Silverton

In the past year or so, Oracle has recently started purchasing/bidding on open source companies/products:

Oracle buys sleepycat software

excerpt: “Sleepycat’s Berkeley DB is embedded in several well-known open source products, including the Linux and BSD Unix operating systems, Apache Web server, OpenLDAP directory and OpenOffice productivity suite, Oracle said Tuesday”

Oracle buys innobase

excerpt: “Innobase is the developer of discrete transactional database technology, InnoDB, that is distributed under an open source license. “Oracle has long been a supporter of open source software such as Linux and Apache,” said Charles Rozwat, Oracle’s Executive Vice President in charge of Database and Middleware Technology. “Innobase is an innovative small company that develops open source database technology. Oracle intends to continue developing the InnoDB technology and expand our commitment to open source software. Oracle has already developed and contributed an open source clustered file system to Linux. We expect to make additional contributions in the future.”

InnoDB is not a standalone database product: it is distributed as a part of the MySQL database. InnoDB’s contractual relationship with MySQL comes up for renewal next year. Oracle fully expects to negotiate an extension of that relationship.”

Oracle bids on mysql

excerpt: “MySQL, based in Sweden and Cupertino, Calif., announced in January that it’s been profitable for two quarters. But it’s not turning down outside money. MySQL announced Monday it raised $18.5 million in a third round of funding from Institutional Venture Partners, Intel Capital, Red Hat, SAP Ventures and Sumitomo’s Presidio STX investment subsidiary.

Oracle’s financial moves, however, are orders of magnitude grander. Its major buying spree resulted in the acquisitions of Siebel Systems for $5.8 billion and PeopleSoft for $10.3 billion.”

What does this mean for open source?

Open source is starting to become a real threat to the commercial application companies of the world. Applications such as apache, mysql, postgres, and linux are gaining momentum and are becoming better and than than their commerical counterparts.

How can a company defend against the power of the community? The greatest strength of open source is the fact that it can’t be bought or sold as a whole. Even if a new, closed source and proprietary version comes out of a project, the community can still continue developing the open sourced version.

a representitive from Oracle stated the following in a press release :

“innoDB is not a standalone database product: it is distributed as a part of the MySQL database. InnoDB’s contractual relationship with MySQL comes up for renewal next year. Oracle fully expects to negotiate an extension of that relationship.”

Oracle is a business with their stock holders as their main objective. Purchasing innobase, which is an integral part of the mysql database system, is the first step in taking it over. It seems okay right now, but if they start losing martketshare, there is no telling what they might do.

Another weapon large companies have against OSS is money and resources. This means they have the ability to hire the top developers of a project and basically take it off the map for awhile as a competitor.

recently, Microsoft did something like this and it backfired

Share and Enjoy: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Digg
  • del.icio.us
  • DZone
  • Slashdot
  • StumbleUpon
  • Technorati
1 comment

« Previous PageNext Page »