Stress test with apache ab

I didn’t know at all apache ab sine yesterday when a guy who is working with us told me about this tool included in apache distribution.
Then I used with my site on localhost using this command line:

ab -n 9000 -c 900 localhost:8080/index.php

I got this results:

 Completed 900 requests Completed 1800 requests Completed 2700 requests Completed 3600 requests Completed 4500 requests Completed 5400 requests Completed 6300 requests Completed 7200 requests Completed 8100 requests Finished 9000 requests

 Server Software:        Apache/2.0.55 Server Hostname:        localhost Server Port:            8080

 Document Path:          /index.php Document Length:        37949 bytes

 Concurrency Level:      10 Time taken for tests:   407.890625 seconds Complete requests:      9000 Failed requests:        25    (Connect: 0, Length: 25, Exceptions: 0) Write errors:           0 Total transferred:      342093375 bytes HTML transferred:       340598850 bytes Requests per second:    22.06 [#/sec] (mean) Time per request:       453.212 [ms] (mean) Time per request:       45.321 [ms] (mean, across all concurrent requests) Transfer rate:          819.03 [Kbytes/sec] received

 Connection Times (ms)               min  mean[+/-sd] median   max Connect:        0    0   2.7      0      78 Processing:   140  452 217.8    359    2265 Waiting:       31  402 194.0    328    2218 Total:        140  452 218.0    359    2265

 Percentage of the requests served within a certain time (ms)   50%    359   66%    390   75%    421   80%    515   90%    750   95%    968   98%   1156   99%   1281  100%   2265 (longest request)

Mmhh.. 25 errors with 9000 connection and 900 concurrency level?
I must admit I never used stress test tool at all by my own, just one time I see it used when working for a big java based project.
Do you use some kind of benchmarking tool?

Is your Web application secure?

“No language can prevent insecure code, although there are language features which could aid or hinder a security-conscious developer.”

An interesting article on Security Focus illustrates examples on PHP coding and vulnerabilities.
The attacks explained in the article are:
1. Remote code execution
2. SQL injection
3. Format string vulnerabilities
4. Cross Site Scripting (XSS)
5. Username enumeration
http://www.securityfocus.com/infocus/1864

Backup your batabases w/o phpmyadmin

I often read threads about export/import data from MySQL and it’s always mentioned phpmyadmin as the only way to do that (with PHP indeed).
But that’s not true, and it’s indeed the slower way to do that, expecially when importing large database files (because phpmyadmin has problems with large db)…
This would be just a reminder 🙂
Use an SSH client, like putty (if your database is on a remote server), to connect to your server and export the databse you want simply with:

mysqldump –user=username –password=1234 –databases your_database –opt –quote-names –allow-keywords –complete-insert | bzip2 -c > your_database.sql.bz2

download the .bz2 file created, unzip it using 7-zip (if you dont have any other uncompress utility), and backup your database in mysql using:

mysql –user=username –password your_database < your_database.sql

that’s faster than using “import” from phpmyadmin
http://dev.mysql.com/doc/refman/5.0/en/mysqldump.html

IE’s ActiveX D-Day

As Microsoft announced time ago, the next generation of Internet Explorer will change the way the browser handles ActiveX controls with a significant impact on how online advertising and streaming media content is delivered over the Internet.
The software maker plans to give Web developers an extra 60 days to continue making preparations.
The big push now is for developers to recode Web sites and Web applications to cater for the browser update. If not, users won’t be able to directly interact with Microsoft ActiveX controls loaded by the APPLET, EMBED or OBJECT elements without first activating the user interface with an extra mouse click.
Get the Internet Explorer 7 beta preview


http://www.eweek.com/article2/0,1895,1943847,00.asp

MySQL Workbench 1.0.5

MySQL has released some days ago a new tool for Database Design.
It can handle tables, stored procedures, functions, triggers and views of your existing databases (using the reverse engineering command).
Some features:
– Reverse engineering of existing MySQL databases
– Import DBDesigner4 models
– Synchronize edited model with MySQL database
– Generate SQL create script file
– Printing (Windows)
– Powrefull scripting and plugin interface. Plugins can be written in several languages, such as Lua, PHP, Java and
Python.
– Fast, OpenGL based graphical canvas
It is available for Windows, Linux and MacOSX too.
There’s also the source code free for download.
I found also a very nice Database tool, with tons of features, even if the GUI is not really usable (in my opinion): Aqua Data Studio 4.5
In these days I worked a lot with MySQL 5 and it’s new features and I found those tools very comfortable for my needs.
I hope my hosting provider (mediatemple) will upgrade mysql server too, which is still the 3.23.58!
http://forums.mysql.com/read.php?98,73820,73820#msg-73820

Gtalkr

Anybody using Gmail? How about Google Talk?
If so, 2Entwine has created a truely awsome Flash App called Gtalkr!! Right now it is Beta 2.0.0.67, but in my opinion a very promising RIA (Rich Internet Application).

  • Google Talk contact information
  • Contact presence changes
  • Gtalkr Notifier integration
  • Drag and drop support

It lists friends, your Gmail Account, a Flickr slideshow, a YouTube component, and much more…
Still not enough? Well Gtalkr also has a blog, Everything Gtalkr that will keep you up to date!!
Still want more? Well it even supports extensions!! A combination of XML and Flash…”you’ll need to create the Flash file that Gtalkr will load.”
I see a lot of potential in this application and fresh view on customization that other portal technologies lack….
https://gtalkr.com/