A look into Solaris, by Derek Crudgington

Setting up PHP on Sun Java System Web 7

July 6th, 2007

Setting up PHP on Sun Web 7 is really simple. My small sized Accelerator has no issues running it, only that I had to tune down the threading and make sure the admin server is disabled when you are not using it because it takes up around 200MB of memory. So before you go running anything, I’d recommend clicking through the admin web console and disabling things that aren’t needed: webdav, java, check thread pools, check caching.

There are a few different ways you can run PHP on Sun Java System Web. NSAPI, Fastcgi, and Cgi. Each one has pros and cons explained here. In this config, I use the NSAPI plugin.

To get started download the PHP Plugin pack and extract it in your webserver7/plugins directory. The PHP pack comes already compiled with MySQL and PostgreSQL support. Here’s the steps:

# cd /opt/webserver7/plugins
# gzip -dc phppack-5_2_0-solaris-amd64.zip | tar xvf -
# cp php/php.ini-recommended php/php.ini

Add these lines to your magnus.conf file:

Init fn=”load-modules” shlib=”libphp5.so” funcs=”php5_init,php5_close,php5_execute,php5_auth_trans”
Init fn=”php5_init” errorString=”PHP Initialization Failed!”

In your https-server-name/config/obj.conf under Object name=”default” section, add:

* There may be more than one file with obj.conf, to find out which one you are using you can use the wadm command line: webserver7/bin/wadm get-virtual-server-prop –user=admin –config=server-name –vs=server-name object-file

Service type=”magnus-internal/php” fn=”php5_execute”

Also in the obj.conf, modify your PathCheck to include index.php

Finally, add the mime type to https-server-name/config/mime.types:

type=magnus-internal/php exts=php,php3,php4,php5

and now restart your web instance for changes to take effect. You should see something like this when it starts:

info: php5_init reports: Initialized PHP Module (20 threads exspected)

If you have any issues, check the README in the plugins/php dir, it has troubleshooting information.

Now serving from Joyent Accelerator

July 6th, 2007

I finally got around to doing something cool with my blog. A new look and image, a new webserver, and also now serving it up from my Joyent Accelerator.

Becoming familiar with something other than Apache has been really exciting. Running my blog on Sun Java System Web 7 will help me become more familiar with the product and what it has to offer, so be on the look for cool stuff I may post about it. I already know that setting PHP up on it is a breeze.

If anyone could tell me how to get rid of this favicon that would be great though, disabling it in the config doesn’t seem to do anything.

Sun Studio 12 compile times

July 6th, 2007

Here are some results I did on a test compiling MySQL 5.0.41 with Sun Studio 12 vs GCC 3.4.5. This was on a x4100:

Single threaded test:

GCC 3.4.5:

# time make
real 8m36.944s
user 6m53.556s
sys 1m24.685s

Sun Studio 12:

# time dmake
real 6m54.376s
user 9m34.147s
sys 2m3.422s

Conclusion: Sun Studio 12 owns.

Here are some other results of a threaded compile with Sun Studio 12 just to show off:

# time dmake -j 8
real 6m11.507s
user 9m44.306s
sys 2m17.845s

# time dmake -j 4
real 5m52.583s
user 9m52.261s
sys 2m16.401s

4 threads is the sweet spot which is the number of CPU’s in the system.

Cooling your Ferrari down

June 19th, 2007

If you’ve ever owned a Acer Ferrari 3400 or 4000 you know that they run extremely hot. This really sucks if you run Solaris, especially with ZFS. It will chew up processing like no other and can heat up your Ferrari so bad it might even just shut off.

This is where the Notepal by Cooler Master comes in. There are a few different models of the Notepal but I have the Notepal W1.

I purchased mine at Fry’s for $29.99 and it works really good. It’s made out of aluminum and has two fans at the bottom (powers off of USB) that suck the air away from the laptop. The website reports it will lower by 7 degrees but I am seeing up to 10 degrees. I definitely recommend this if you are having the same heating issues as I was.

Ferrari 4000, replacing wireless with Atheros CM9

May 20th, 2007

I decided to buy the Atheros wireless card to replace the Broadcom card in my Ferrari that is worthless in Solaris. It’s only $45 so I figured why not. Installation was simple.. just unscrew a panel on the bottom of the laptop and put the new one in.

Booted up, Solaris loved seeing it instead of that Broadcom card. I didn’t have to do anything except create my wireless profile:

# wificonfig createprofile home essid=xxxxxx encryption=wep wepkey1=xxxxxx

dladm shows it too.

I definitely recommend this card to anyone that is looking for a mini-PCI wireless module for their laptop. Now all I need to do is upgrade to b64 to get NWAM/WPA support. test

.

.

.

.

Are you looking for reseller hosting services? Nowadays many web hosting companies are offering reseller services with good features like web site design services. Many of these companies are working by purchasing colocation hosting servers but others like hostgator are offering quality services with their own data center. Additionally these companies offer pc software as their basic feature. For the handling of such softwares webmasters need to have good IT knowledge in the form of 70-528 and 70-293 certifications.

Satisfied

April 22nd, 2007

The past few months I’ve been desperately looking for a job I would enjoy. Getting tired of the same ole lame Admin/Unix/Network typical corp whatever jobs, it got really irritating for a while trying to find something interesting. When I was looking I came across Joyent wanting admins and I didn’t submit thinking they wanted someone local. Then I finally got tired of not finding anything.. so I submitted, ready to move to CA. All I could think was if it takes to move across the US to do what I really want to do, I think it would be worth it.

Why couldn’t I find a job like that in Texas? Because Joyent is doing things no one else is doing. Things like Accelerators, which go along with running the largest OpenSolaris install in the world, and SlingShot which takes Rails application development to a whole new level.

I’m finally glad to say I’ve found the job that I’m going to enjoy. I’ll be working with awesome things like OpenSolaris, ZFS, DTrace, and also with some of the greatest administrators out there like Mark Mayo, Ben Rockwood, and Jason Hoffman, not to mention our CEO, David Young (a native Texan), who really understands the Dickey’s BBQ.

I feel very lucky to be a part of this team and I can’t wait to see what the future holds.

.

.

.

.

Hosting services are among the basic requirements of any web site and one can find hundreds of companies offering different types of hosting such as php hosting, windows hosting and Linux hosting. Yet the startlogic is undoubtedly the best company providing advanced hosting services with reliable backup. Streaming media hosting is the advanced form of hosting services and recommended for sites offering online courses like 310-200 as well as 642-503 or providing helping materials for microsoft courses such as 70-291 online.

Check out the syscalls

April 12th, 2007

This was on a T2000 box with 1 thread pinned at around 180,000 syscalls per second:

# vmstat 1

kthr memory page disk faults cpu
r b w swap free re mf pi po fr de sr 1m 1m 1m 1m in sy cs us sy id
0 0 0 45446528 21367256 0 0 0 0 0 0 0 0 0 0 0 739 180876 776 1 2 96
0 0 0 45446528 21367256 0 0 0 0 0 0 0 0 0 0 0 735 181411 777 2 2 96
0 0 0 45446528 21367256 0 1 0 0 0 0 0 13 13 0 0 720 180982 740 1 2 97
0 0 0 45446528 21367256 0 0 0 0 0 0 0 0 0 0 0 738 180826 755 1 2 96
0 0 0 45446528 21367256 0 0 0 0 0 0 0 0 0 0 0 831 180869 810 1 2 96
0 0 0 45446528 21367256 0 0 0 0 0 0 0 0 0 0 0 745 180902 794 1 2 96
0 0 0 45446528 21367256 0 1 0 0 0 0 0 0 0 0 0 708 181005 719 1 2 96
0 0 0 45446528 21367256 0 0 0 0 0 0 0 0 0 0 0 706 180835 717 2 2 97

Because this was on a T2000, and the most likely the application isn’t multithreaded, the calls were only pinned to one thread only affecting that thread and that core (4 threads share a core). mpstat showed this thread at around 180,000 syscalls per second and 0 idle time. I wonder if that is the max syscalls a thread can handle. Putting this process on another machine I bet the calls would of went way higher causing a huge performance hit. Unfortunately I didn’t get to investigate further.


.

.

.

.

Someone looking to buy domain names can get it from any web hosting company. Especially the companies like startlogic offer free domain name with their dedicated server. Additionally anyone looking for internet software can get it from such companies along with hosting services. But to handle these network software people need to have basic IT knowledge in the form of 310-055 and 156-215. Other than this people having 642-552 certification gets handy advantage over the others.

T2000 Apache/PHP/MySQL

March 2nd, 2007

An update to my previous post, here are some results for Apache/PHP/MySQL. I used Apache 2.2.3 (prefork), PHP 5.2.1, MySQL 5.0.27, and APC 3.0.13. These were custom compiled pretty much the same options the CoolStack uses, with Sun Studio 11.

APC is the PHP caching extension for PHP, and the apc.stat setting in the php.ini tells it to check if the php file has changed and if it has, recompile it and cache it. Using apc.stat on or off didn’t seem to make much of a difference. These tests were done with apc.stat on. For Apache I have mem_cache turned on as well.

5 rows and 1 column of MySQL returning:

# ./ab -n 50000 -c 500 http://x.x.x.x:30000/test.php
This is ApacheBench, Version 2.0.41-dev < $Revision: 1.121.2.12 $> apache-2.0
Copyright (c) 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Copyright (c) 2006 The Apache Software Foundation, http://www.apache.org/

Server Software: Apache/2.2.3
Server Hostname: x.x.x.x
Server Port: 30000

Document Path: /test.php
Document Length: 67 bytes

Concurrency Level: 500
Time taken for tests: 4.793971 seconds
Complete requests: 50000
Failed requests: 48583
(Connect: 0, Length: 48583, Exceptions: 0)
Write errors: 0
Total transferred: 11475208 bytes
HTML transferred: 823930 bytes
Requests per second: 10429.77 [#/sec] (mean)
Time per request: 47.940 [ms] (mean)
Time per request: 0.096 [ms] (mean, across all concurrent requests)
Transfer rate: 2337.52 [Kbytes/sec] received

Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 4 3.8 4 30
Processing: 15 41 59.6 29 1036
Waiting: 14 40 59.1 28 1032
Total: 23 46 59.7 33 1042

36 rows and 6 columns of MySQL returning:

Requests per second: 10448.16 [#/sec] (mean)

134 rows and 7 columns of MySQL returning:

Requests per second: 801.05 [#/sec] (mean)

Performance really degrades on the 134 row test and I think MySQL is the bottleneck here. More to come on this when I get MySQL recompiled.

UPDATE: This is the results without APC cache turned on at all, with 36 rows and 6 columns:

Requests per second: 2242.18 [#/sec] (mean)

As you can see APC cache helps a lot, it went from 10,000 req/sec to 2,000 req/sec.

Â

T2000 apache, prefork or worker?

March 2nd, 2007

These tests were done with 2.2.3 prefork and 2.2.4 with worker. Both of them were tested with mem_cache and without. mem_cache seemed to really improve the performance of prefork but it didn’t do anything for worker, it actually hurt the performance by a little bit. Worker also seemed to drop a core file when it got too much traffic. The index.html is a small 175 byte file that loads a 5 of the apache powered by gif files and the httpd.conf were both stripped with minimal modules loaded. From the transfer rate apache bench shows I think the bottleneck here is the network.

The mem_cache settings:

CacheEnable mem /
MCacheSize 320000
MCacheMaxObjectCount 1000
MCacheMinObjectSize 1
MCacheMaxObjectSize 4048

Apache 2.2.3, prefork with mem_cache (-n 100000 -c 1000):

Requests per second: 11566.21 [#/sec] (mean)

Apache 2.2.3, prefork without mem_cache (-n 100000 -c 1000):

Requests per second: 9492.40 [#/sec] (mean)

Apache 2.2.4, worker with mem_cache (-n 100000 -c 1000):

Requests per second: 12118.41 [#/sec] (mean)

Apache 2.2.4, worker without mem_cache (-n 100000 -c 1000):

Requests per second: 12413.07 [#/sec] (mean)

Blackbox tour

February 19th, 2007

Last week I missed the Lamb of God/Machine head tour, but I did not miss the Blackbox Tour when it came rolling through town. It was definitely a cool event to check out and I took some pics and added a blackbox section to my blog.

Many web hosting companies are offering cheap web hosting packages nowadays. Especially such offers come with linux hosting packages by these companies. But the main disadvantage of such service is the low web space facility which becomes insufficient for ecommerce businesses. Additionally they do not offer phone service with their packages. To overcome this problem specialized computer software is offered by companies. To handle such service packages people need to have good IT knowledge in the form of MB2-422 and 642-425.