AAF: AAOBloggers

:)

Archive for the ‘Reviews’ Category

ab from apache (ARABIC)

with 2 comments

إختبر قدرة و سرعة موقعك (او مدونتك)

by JOHNNIE W@LKER (and these are only the test servers)

by JOHNNIE W@LKER (and these are only the test servers)

السلام عليكم و رحمة الله و بركاته…

معظم من يقرء هذا الموضوع يعلم أن المواقع التي يراها على الإنترنت ماهي إلا ملفات ترسل الى متصفحك من قبل برنامج يسمى ال”سرفر”(server)، و الذي يختلف عن الجهاز الذي يعمل عليه (ايضا يسمى “سرفر”).
هناك عدة انواع من برامج السرفرات، ولعل ابرزها:

ا- اباشي (Apache): من أشهر و أفضل برامج “سرفر” في العالم
ب- مايكروسوفت IIS: بصراحه، ليست لدي أي فكره عن سبب إستخدامه حيث أن Apache افضل منه و أرخص (مجاني)

البرنامج الذي يتناوله هذا الموضوع أحد البرامج المدرجة مع اباشي ويسمى ب”ab”. هذا البرنامج يقوم بمحاكاة زوار المواقع حيث يقوم بدخول الى الموقع المراد إختباره كزائر طبيعي (لا يوجد فرق بين نوع السيرفر المراد إختباره، فab يعمل مع جميع أنواع سيرفرات HTTP). و يمكنه محاكات مستخدم واحد او الف مستخدم. و يلي نموذج لهذا (10 مستخدمين و 1000 طلب (request)):

Server Software:        Apache/2.2.11
Server Hostname:        localhost
Server Port:            80

Document Path:          /
Document Length:        14593 bytes

Concurrency Level:      10
Time taken for tests:   0.849 seconds
Complete requests:      1000
Failed requests:        0
Write errors:           0
Total transferred:      14942826 bytes
HTML transferred:       14622186 bytes
Requests per second:    1178.15 [#/sec] (mean)
Time per request:       8.488 [ms] (mean)
Time per request:       0.849 [ms] (mean, across all concurrent requests)
Transfer rate:          17192.28 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        1    3   2.3      3      16
Processing:     1    5  17.6      3     209
Waiting:        0    4  16.1      2     207
Total:          3    8  17.6      6     210

Percentage of the requests served within a certain time (ms)
  50%      6
  66%      6
  75%      7
  80%      7
  90%      8
  95%     17
  98%     19
  99%    159
 100%    210 (longest request)

في المثال السابق يمكن معرف سرعة النقل (17192.28 Kbytes/sec (لأنه localhost)) و معدل الزوار بالثانية (1178.15).

لتنزيل البرنامج، يمكنك زيارة http://www.apache.org. اذا كنت تستخدم أوبونتو، اكتب
sudo apt-get install apache2-utils
في Terminal.

لإستخدامه أكتب
ab -c م -n ع http://www.شيء.com:80/
حيث أن “م” تمثل عدد المتخدمين و “ع” تمثل عدد الطلبات و شيء يمثل الموقع/المدونة المراد إختبارها. يلي مثال بسيط على هذا:

ab -c 1 -n 100 http://araby.com:80/

سيقوم بإختبار http://araby.com كمستخدم واحد خلال عشر طلبات

أختم بالقول ان هذه الأدة مفيده ولكن يرجى إستخدامها لتجريب مواقعكم الخاصة وليس على مواقع الغير لأنها قد تستهلك سرعة السرفر في الرد على الاخرين.

و السلام عليكم و رحمة الله و بركاته

SIGTERMer

Written by seininn

April 29, 2009 at 7:14 am

Posted in Articles, HOW-TOs, Reviews

wget: more versatile then a trusty swiss-army knife

leave a comment »

wgetwget

A tool that makes life that much easer…

This is by far the most useful command-line tool when it comes to dealing with the web. wget is a small simple-to-use tool that allows you to get content from other sites. this includes html, tar balls, and anything else the server is willing to provide.

if you’re wandering what good it is when there are numerus browsers that do this, read on.

wget (unlike browsers) is a non-interactive tool, meaning it doesn’t need you once it has been given a job. such as downloading an entire directory, say this one. rather than clicking each item on that list, you can simply use wget by issuing this command:

wget -r ftp://ftp.geda.seul.org/pub/geda/release/v1.4

wget can also help by making those pesky online-only documents available off-line. take this for example (i know this is available in downloadable form but this method is applicable on other sites as well)

wget is a well-behaved tool, it will not download from any site that specifies rules prohibiting it. these rules are stored in the root directory of the server (robots.txt). however, most rules are meant to be broken. you can ignore rules by adding the following to the command:

-e robots=off --wait 1

The “wait” has nothing to do with ignoring rules, it simply makes it easer on the server by waiting 1 second between every fetch. please add this when downloading from good sites, and conveniently forget it when downloading from microsoft :p

Also, when recursing, wget will only go down 5 levels. if the site you want to download has a directory structure that goes deeper then this, add

- l

Finally, some sites analyze traffic and can determine if an automated application such as wget is downloading, and can block it. there is an solution to this but i won’t go into it since i never really used it.

enjoy the web with wget 🙂

SIGTERMer

Written by seininn

April 7, 2009 at 12:50 pm

Software Review: TVQuran – An Outstanding Online Quran Player

leave a comment »

TVQuran is an amazing service that aims to stream audio Quran content online. although there are countless sites that do the same thing, TVquran is the first one to provide a small high quality script to embed the player in other sites. it offers a wide range of “mashay5” as well.

player

The following is the code for embedding the player in your webpage (in the voice of mohammed ayob).

<center><iframe align="center" id="IW_frame_1438" src="http://www.tvquran.com/add/Ayyub.htm&quot; frameborder="0" allowtransparency="1" scrolling="no" width="302" height="334"></iframe></center>

please remember that the quran is not something you listen to on the side, so please specify a special page for it

if you don’t own a site and still want to benifit from the service, you can go directly to www.tvquran.com/ or you can copy the following code and paste it into a local file. keep in mind that you must specify the “.html” extension unless your system can figure it out by itself.

<head>
<body>
<center><iframe align="center" id="IW_frame_1438" src="http://www.tvquran.com/add/Ayyub.htm&quot; frameborder="0" allowtransparency="1" scrolling="no" width="302" height="334"></iframe></center>
</body>
</head>

one note though, it shouldn’t start by default. other than that it’s a great project. remember to pass this on to everyone you know, that’s how it got to me…

SIGTERMer

Written by seininn

April 4, 2009 at 1:49 pm

Posted in Articles, Reviews, Software

Python is not for me

leave a comment »

It’s been about a week since i started working as a programmer and 10 long days with python.  i am required to program in python, a language i have never thought i would need to learn, to implement small utilities that major programmers don’t have the time for (grunt work). as a c programmer for most of my digital life, i had a “trouble” getting the hang of it. such as implementing an algorithm in 3 minutes which requires 3 hours of debugging. anyways, as i went along, concerns regarding python started to rise. here are the top of my list:

  • I have noticed that python 2.6.1 is not compatible with python 3.0. although there is a script(s) that might help make the transition more smother. i can’t help but feel that my programs i write well break sooner or later.
  • C only needs the runtime libraries, and those can be statically linked so the program will run on its own. python needs an entire interpreter as a pre-requirement. this is one of the main reasons why i ditched java (an additional 80MB download and a whole virtual machine  to run a 15k program is ridicules).
  • Depreciation.. perhaps this is more related to the first point. but if i leave my script for, say 10 years, will it still run?
  • No matter how you do it, python can never be as fast as c (libraries aside)
  • whitespace. i guess i’m too attached.

There were more but i can’t remember. despite having these concerns, it does have it’s good sides:

  • great built-in support for types. and the exception system is a treat. no need to check, just do
  • a rich set of standard modules are included. networking, threading, …
  • great for web development
  • a good set of documentation

Personally, this advantages alone are not enough. i’ll probably stop developing in python as soon as can. although, i might still use it for networking and web development (beats learning php).

Only time will tell…

SIGTERMer

Written by seininn

April 3, 2009 at 5:49 am

Posted in Articles, Reviews, Software