Monday, April 28, 2008

Yahoo Go SDK กับ เก็บบล็อกชาวบ้าน

http://www.narisa.com/blog/patrickz/index.php?
http://www.narisa.com/blog/patrickz/index.php?s=2a706888b75cb7991858c1b060e0267f&showentry=1534

http://www.blognone.com/node/6681

http://www.funambol.com/blog/capo/2008/01/yahoo-go-because-we-all-love-sdks.html
ํYahoo Go! SDK
http://mobile.yahoo.com/developers/platform;_ylt=Ajm45K1X6D15tFdqV49pyml8tQcJ

Tuesday, January 08, 2008

Yahoo Go: because we all love SDKs

If you are a mobile developer, you are already a frustrated individual. You dream of a world with one mobile operating system and one SDK (wait, are you sure, take a look at what you have in front of you...), instead Yahoo at CES has just announced yet-another-mobile-SDK.

Damn, can't life in mobile be easier?

If you want to build a mobile app today, you can choose from:
  • JavaME: great reach but you need to develop one app per phone, so that's about one billion slightly different apps... But just slightly.
  • Symbian: not a bad idea, big reach, stable platform, maybe boring. I could even build a JavaME app and tweak it to become native.
  • Windows Mobile: very small market share and not growing, but easy to build. Tough, who wants to build for a Microsoft operating system? Really uncool... If my boss forced me to do it, I will. But please boss do not force me to do it.
  • iPhone: that would be cool, the thing attracts girls and its market share will boom fast (although the device is not really robust). Wait, I have to hack it and there are no APIs. Even cooler! It might get boring when they announce the SDK in February, though...
  • Android: whooo!! supercool. Too bad there are no devices and it will take a few years for it to have a meaningful marketplace. Hey, but you can get money from Google with the Android Challenge...
  • BREW: what? No, please. I do not want to develop in a box with high walls.
  • PalmOS: is it still alive?
  • Flash: nice, but it is ready for prime time? It could actually be the answer to JavaME portability in the long run. Wait and see.
  • A dozen variations of Linux, lead by OpenMoko (because I like them), including Maemo and many others: go for it, man! We need people that love to dream in this world! Worst case scenario: you'll port it back to Android in a year. It is a mobile Linux variation, after all.
  • Another ten or so I forgot, like Sony PSP and many more
When you think you are done with the list, boom! Yahoo comes up with a mobile platform over a mobile operating system. A sort of a middle layer that allows you to develop your applications on top of that. Not that far, as a concept, from JavaME or Flash. Certainly, more focused in scope.

The issue? Well, a mobile platform over an operating system might be a bit large in size and slow as hell. Hey, you can always hope in Moore's law.

The opportunity? Well, they already ported their platform over the other operating systems. If they make it really consistent (doable), you develop once and it will run everywhere. That's a developer dream.

The risk? Well, for your app to succeed, you need the underlying technology to succeed. If people do not download Yahoo Go on their phone because it is too large and too slow, you are toasted. Uuhhmmm.

Overall, I like Yahoo's move.

They needed to come up with something (anything ;-) to counter Google and Apple. They did it.

I am a fan of the mobile widget concept, as you might remember. In one of my first posts on this blog, I mentioned Yahoo going for WAP but my prediction was they would go back to mobile widgets one day. They did it.

Now they just have to make sure consumers love the platform and developers build the widgets. The problem is that the two are linked. One drives the other. And getting developers mind share in mobile is very very hard these days...

Good! Luck! To! Yahoo!



Yahoo! เปิดตัว SDK สำหรับมือถือ

tags:

ช่วงนี้งาน CES จัดที่ลาสเวกัส หลายบริษัททยอยใช้เวทีนี้เปิดตัวผลิตภัณฑ์ใหม่กันชุดใหญ่

ของ Yahoo! ได้ดำเนินรอยตามแอปเปิลและกูเกิล โดยเปิดตัว SDK สำหรับมือถือกับเค้าบ้าง เพียงแต่ที่ต่างออกไปคือไม่ใช่ SDK เฉพาะรุ่นเหมือนแอปเปิล หรือระบบปฏิบัติการแบบกูเกิล แต่เป็นแพลตฟอร์มที่รันบนระบบปฏิบัติการของมือถือที่มีอยู่ในตลาดอยู่แล้วอีกชั้น

แพลตฟอร์มนี้มีชื่อว่า Yahoo! Mobile Developer Platform โดยจะเรียกแอพพลิเคชันเป็น Mobile Widget ซึ่งเขียนด้วยภาษา Blueprint (เป็น XML+XForms เหมือนกับ XUL หรือ XAML คือไม่ได้เป็นภาษาโปรแกรมมิ่งเต็มตัว) เจ้า Mobile Widget เหล่านี้จะรันได้ 2 ที่ คือ

  • โทรศัพท์มือถือที่ลง Yahoo! Go 3.0 ได้ (ปัจจุบันมีประมาณ 30 รุ่น มี BlackBerry, Nokia และ Sony Ericsson ส่วน LG กับ Motorola ออกข่าวแล้วว่ากำลังทำอยู่)
  • โฮมเพจของ Yahoo! เวอร์ชันมือถือ (สำหรับโทรศัพท์ที่รััน Yahoo! Go 3.0 ไม่ได้)

ผมตามไปดูในเว็บไซต์ของ Yahoo! รู้สึกจะยังไม่ค่อยเรียบร้อยดี คือสามารถดาวน์โหลดได้เฉพาะตัว Yahoo! Go 3.0 Beta แต่ส่วนของ widget กับตัว SDK ยังไม่มีให้ดาวน์โหลด (มีแต่เอกสาร และ XML Schema ของภาษา Blueprint) ก็คิดว่าคงจะตามมาในเร็วๆ นี้ครับ

ที่มา - CNET, Ars Technica, WebWare

Sunday, April 27, 2008

คอมไพล์ GD บน Linux

ที่มา http://www.numvarn.com/blog/node/4
เนื่องจากตั้งแต่ติดตั้ง package บน Linux ที่ Tom ลงไว้
ไม่เคย compile ด้วยตัวเองสำเร็จ ต้องพึ่ง RPM หรืออย่างน้อยก็ YUM เสมอๆ

วันนี้ check ว่า Server จริง ก็เป็น RHEL5 ถ้าเกิดต้องลง GD ขึ้นมาจริงๆ ยังไงก็ต้อง Compile เอง
ก็เลยเอาเวบนี้ http://www.numvarn.com/blog/node/4
มาเป็นแนวทาง

jpegsrc.v6b.tar
libpng-1.2.5.tar
Compile PHPใช้เวอร์ชั่น php-5.2.0.tar

# ./configure --prefix=/usr/local/apache2/php \
--with-zlib \
--with-xml \
--enable-cli \
--enable-exif \
--enable-ftp \
--enable-mbstring \
--enable-mbregex \
--enable-dbx \
--enable-sockets \
--with-gd \
--with-jpeg-dir=/usr/local \
--with-png-dir=/usr/local \
--with-mysql=/usr/local/mysql \
--with-apxs2=/usr/local/apache2/bin/apxs
#make
#sudo make install

ทำการติดตั้งเรียบร้อยแล้วให้ทำการแก้ไขค่า Config ของ Apache ให้รู้จักกับ PHP ได้โดยแก้ไขไฟล์ /usr/local/apache2/conf/httpd.confโดยทำการเพิ่มAddDefaultCharset UTF-8 และ
AddType application/x-httpd-php .phpเพิมเติม :
ลิงค์ที่สามารถเข้าไปหาข้อมูลเพิ่มเติมได้อืก
http://www.phpmac.com/

ก็มั่วๆไป พอดี Tom ช่วยเรื่อง php ก็สบายหน่อย ใช้ได้แล้วหละ

Friday, April 25, 2008

ใช้ yum

วันนี้ได้ใช้ yum เนื่องจาก download มา compile เองไม่ได้ตามเคย
ที่จริงตั้งใจจะใช้แค่ jpgraph เฉยๆ แต่มันต้องการ lib-gd

บน Windows ก็ไม่มีปัญหาอะไร แค่ไป un comment ออกซะ
ที่ file php.ini
extension=php_gd2.dll ออกซะ จะได้โหลดมาใช้ อย่าลืม restart

แต่บน linux มันดันไม่มี php.ini แล้วถ้าจะให้มีมันต้องทำอะไรนิดหน่อย
ซึ่งนิดหน่อยนี่เราไม่กล้าทำ ก็เลยพยายามใช้ yum ลงแทน

yum เป็น tools ตัวนึงที่จะทำการ download และ install package ต่างๆที่ dependency กันอย่างมากมาย
ถ้าเราทำเองเราต้องโหลด version นี้ เพื่อที่จะเข้ากับ version นี้ เป็นทอดๆ ไม่รู้จบ

ใช้ Yum ดีกว่า เพื่อฉลองความสะดวก และเพิ่มความโง่ให้กับผู้ใ้่ช้งาน ซึ่งผมยินดี

ก็ใช้ yum install php-dg บน test localhost เป็น fedora8 ก็โอ แต่ server ของ Tom ดันเป็น RHEL4 ซึ่งเก่าจริงๆ จนไม่มี package ตามที่ header มันเรียกหา ทำให้ ใช้ Yum ไม่ได้

ที่จริงมันแย่กว่านั้น เพราะมันไม่มี yum ด้วยซ้ำ ซึ่งก็ต้องไปโหลดมาเอง เอา version ใหม่จัดก็ไม่ได้นะ
Redhat4 ต้องใช้ version 2 ลองมาแล้ว
http://linux.duke.edu/projects/yum/download/2.6/ <-== ไปหา RPM มาลงเองซะก่อน ด้วยความโง่ก็ทำอะไรไม่ได้ คอมไพล์เองไม่เป็น ก็เลยพยายามแก้ /etc/yum.conf เอง เพราะมันไม่มีไฟล์ yum.repos.d นี่นา จริงๆก็ลองสร้างเอง แต่สุดท้ายระบบมันก็มา edit ที่ yum.conf ก็เลย edit ตรง แก้ไปให้มันไปชี้ path ที่ redhat version 7 แทน โหลดได้บาง package แต่ก็ error ลอง search ได้ solution จากคนนี้ http://fixunix.com/redhat/262625-fedora-core-4-yum-repository.html > The Fedora Core 4 repository seems to have been suspended. Is there
> another copy of this repository online ? And if so how do I pointmy
> machine at it ?
>
> I have a machine that will not run Fedora Core 5 or later and need to add
> some packages.


I added the following line to the '[base]' section in
'/etc/yum.repos.d/fedora-legacy.repo' :-

baseurl=http://download.fedora.redhat.com/pub/fedora/linux/core/4/i386/os

This now redeems my old Fedora Core 4 machine

It also seems there are alot of extra packages availiable possibly ?

Aaron

นี่ไง baseurl=http://download.fedora.redhat.com/pub/fedora/linux/core/4/i386/os

ก็เลยลอง ตอนนี้กำลังโหลดอยู่ ผลเป็นไงเดี๋ยวรู้กัน

ปล repository ของ RHEL
http://mirror.dulug.duke.edu/pub/yum-repository/

Thursday, April 24, 2008

php.ini อยู่ไหน


Article:
PHP 4.3 and Mac OS X
Subject: where is php.ini
Date: 2003-01-17 00:45:01
From: anonymous2

Anyone know where php.ini is installed after completing this process? I couldn't find it in /etc or /usr/lib/php.

Full Threads Oldest First

Showing messages 1 through 4 of 4.

  • where is php.ini
    2003-02-28 18:40:14 tychay [Reply | View]

    The default compile of php no longer installs a php.ini file.

    There are two included with the php distribution php.ini.dist and php.ini.recommended(?).

    The place to put the config file is in /etc/php.ini (if using Apple's directives) or /usr/local/etc/php.ini (if using the default configure, or Mark's compile). The quick way to find out (assuming php4.3+) is

    bash-2.05a$ php -r "phpinfo();" | grep Configuration
    Configuration File (php.ini) Path => /etc
    Configuration

    If you can't do that (because you are using pre 4.3, for shame!) then try the script another post mentioned.

    Hope this helps,

    terry chay
    tychay at php dot net
    • where is php.ini
      2005-06-10 07:46:19 zicco [Reply | View]

      if php -r does not work for your vertion of php, you can do (Linux only):

      echo ""|php |grep Configuration

บน linux
หาได้โดย php -r "phpinfo();" | grep Configuration หรือ echo ""|php |grep Configuration ดีเนอะ

jpgraph วาดกราฟด้วย php ง่ายๆ

สำหรับ mobile อยากได้ง่ายที่สุด คือไม่ต้องถึงกับเป็น flash ต้องการเป็น image ธรรมดา Jpeg หรือ Png ก็ได้
ไปโหลดที่
http://www.aditus.nu/jpgraph/jpdownload.php

ดูคำแนะนำ
http://php.deeserver.net/webboard/odshow.php?No=11345

search เจอะได้อีกเยอะ คนไทยเอามาใช้ ต้องแก้เรื่อง Font นิดนึง
ผมยังไม่ได้ลองแก้เลย เดี่ยวต้องลองหน่อย

Tuesday, April 22, 2008

web service

สร้าง complex type จาก database table หรือ สร้างมือสร้าง method และ add ลงไปใน web service
เพิ่ม case ใน @test_xxxxxxservice
ดู wsdlhttp://xxxx.beta/start/Xxxxxxservice/xUserStats
ทดสอบhttp://xxxx.beta/@test_Xxxxxxservice.php?func=xUserstats&act=xgetRecentVisitors

ระวังตัวใหญ่คัวเล็ก

วงเล็บเปิดปิด if ใน php
และ

Complex type ต้่องตรงกันเด๊ะๆ จึงจะออกมา ระวัง Array ซ้อน Array พลาดมา 2 ทีแล้ว
ดันให้ query สร้าง complex type แล้วลืมห่อ s อีกรอบอ่ะ

ใช้ print_r ออกมาดูก่อนก็ได้

Monday, April 21, 2008

summary openfire info

I.setup
- step 1: execute installer
windows : just double click
linux : using rpm to install
in case of updating : just use rpm -U

- step 2: use browser to connect to port 9090 eg. http://xxxx:9090 as setup wizard
set language, time and database connection string that you should setup it first. see next topic.

II.configure external database.
Openfire provide database script in (/opt)/openfire/resources/database folder.
choose script that match with your DB server. Now we use Mysql then select "openfire_mysql.sql".
Copy it to your pc.

Go to mysqladmin (phpMyadmin or any MysqlGui). Create new database then run script openfire_mysql.sql.


In case of to change database after wizard installation..
- edit /opt/openfire/conf/openfire.xml
find and edit ..


com.mysql.jdbc.Driver
jdbc:mysql://xxxx:3306/openfire_linux
xxxx
xxxx
select 1
true
true
5
15
1.0




III.configure to enable http-bind in openfire (base on openfire version 3.5.0)
enable "HTTP Binding" and set port to selected port
at 'Server' tab > 'Server Setting' > 'HTTP Binging' column in the left


add system properties below if not exist
xmpp.httpbind.client.requests.polling = 0
xmpp.httpbind.client.requests.wait = 10

IV.configure to enable http-bind in apache
see http://www.igniterealtime.org/community/message/156841 and do as suggestion.
if still have problem, see http://www.linuxquestions.org/questions/linux-server-73/authentication-error-openfirejwchat-http-binding-612818/


Config the httpd.conf file of apache

LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_http_module modules/mod_proxy_http.so


ServerName localhost
DocumentRoot /var/www/jwchat

Options +MultiViews

AddDefaultCharset UTF-8
ProxyPass /http-bind/ http://127.0.0.1:8080/http-bind/


V.Increase java memory
See installation manual : http://www.igniterealtime.org/builds/openfire/docs/latest/documentation/install-guide.html
windows Gui - create file name 'openfired.vmoptions' in {openfire path}/bin
- In this file, add the following lines...
-Xms512m
-Xmx1024m
- Restart openfire
windows service - same as normal but change filename to 'openfire-service.vmoptions'

linux manual run- edit /opt/openfire/bin/openfire.sh as http://www.igniterealtime.org/community/message/167950
linux service - see http://www.igniterealtime.org/community/message/151499
- edit /etc/sysconfig/openfire
- find and replace this line
OPENFIRE_OPTS="-Xms256m -Xmx512m"

VI.Add plugin
We can do it at web admin consule (http://xxxx:9090)
'Plugins' tab > Avaliable plugins
select to add plugins by click plus green button in the right (+).

useful plugin is 'User Import Export' plugin. because when we need to change database server, we can use this plugin to migrate all information of user in database without password problem.



VII.Manage user account : Use web admin console > 'Users/Group' tab > user > user summary
If we already installed 'user import/export' plugin, you will see 'Import/Export' sub tab...that we use this to import/export user from/into CSV format.

VIII.See concurrent user and manage (kick user) : also use web admin console > 'Sessions' tab > Active session > Client session
to kick user, use close connection X red button (x) at the right.



.. to enable or disable many feature of openfire, you can find some menu from web admin, rare case as to change database destination need to config in file in {openfire folder}/conf folder.



IX. Testing with ./jabsimule
See link http://www.ejabberd.im/benchmark
1. increase ulimit -n to more than defallt (I use 100000)
2. to generate userm use testsuite tools

cvs -z3 -d:pserver:anonymous@jabbertest.cvs.sourceforge.net:/cvsroot/jabbertest co testsuite
cd testsuite/
cp Makefile.linux Makefile
make userreg

in this package, it
have many tools inside..
use ./userreg to grnerate user name test_{number} to server. (use this tools is enought)
use ./pasvlogin to simulate authentication only with many user.


./userreg -h localhost -u 3000 -n 1
<-h openfire host>
<-u number of users to generate>
<-n number of start user> ex. want to genarate 100 user
we use -n 1 to generate from test_1 to test_100

after that we need to increase to 1000 users
we should us -u 900 -n 101 to generate 900 users start at number test_101

3. get jabsimul to generate bulk of user
wget http://www.ejabberd.im/files/other/jabsimul.tar.gz
tar xzf jabsimul.tar.gz

configure
in {installed folder}/jabsimule/jab_simul/jab_simul.xml

you can download example from 'http://tkabber.jabber.ru/files/badlop/jab_simul.xml.chat60'
to use, rename it to jab_simul.xml

run
call ./jab_simul
or ./jab_simul xxxx.xml if you like to use another configured file


limitation that we have found from using
1. jabsimul cannot simulate user more than around 7000 user per instant
so, you need to use more than 1 instant to simulate more user.
as...

17000

2. number of user to create cannot more than around 50000 ()

like below, jabsimul will occur 'segmentation falut'.


4900056000

to fix you can only reduce number to 50000,
as 4900050000

However, to simulate more user, you can edit jab_simul.xml to change 'resource' or create new series of user account.
(I use import/export plugin to rename from test_xxx to eidos_xxx)




see connerent user in web admin console, session tab.


create script test.sh
nohup /home/sang/jabsimul/jab_simul/jab_simul jab_simul_max${1}.xml > test${1}.log &
use
./test.sh 1 to run 1st configuration
./test.sh 2 to run ... config

X. Increase number of concurrent users which openfire server can support
see how to Increase java memory..
moreover, we found that we need to change ulimit of openfire server too.

XI.Connection Manager
1. go to http://www.igniterealtime.org/projects/openfire/connection_manager.jsp
download and extract connection manager
tar -xzvf connection_manager_3_0_0.tar.gz
mv connection_manager /opt

2. See documentation and installation guide in {connection manager folder}/documentaion/index.html

3. Check that server already install java jdk version more than 1.5 by java -version command
if not, you need to download new verion of java .rpm from java.sun.com

4. Go to openfire web admin(xxxx:9090) Server > Server settings > Connection managers
- tick enable, set port and set password
- click save setting

4. back to connection manager, edit configuration at {connection manager folder}/conf/manager.xml

find and fill information to it

enados.beta

5262

xxxx

5. to use more than 1 connection manager, you have to change this tag in xml file



cm1

1


5



madatory field is 1 that it is idenfied number of connectin manager
which have to be unique number in each connection manager.

6. To enable DNS and HTTP-Bind. We still cannot use this feature..
- To use httpbind it need some servlet java library and change to 'true'..
but It still have a problem with web client (xmpp4js) cannot connect.
- To use DNS, please find more information in connection manage documents

7. run {connection manager folder}/bin/cmanager.bat for windows or chamager.sh for linux

7.1 to increase java vm or fix some problem about java command calling to incorrect java jdk

go to {connection manager folder}/bin ,we can call java bu full path as below

/usr/java/jdk1.6.0_05/bin/java -Xms512m -Xmx1024m -jar ../lib/startup.jar

(in enados.beta I have already created script name is sangrun.sh in {CM folder}/bin)


XII.Clustering
see.. http://www.igniterealtime.org/community/docs/DOC-1471


====================
summary


configure database destination (connection string) : /opt/openfire/conf/openfire.xml at: jdbc:mysql://xxxx:3306/openfire_linux
configure Java VM Size : /etc/sysconfig/openfire at: OPENFIRE_OPTS="-Xms256m -Xmx512m"
configure Connection Manager : /opt/connection_manager/conf/manager.xml

In 'web admin of openfire' you can

change XMPP port,web admin port,SSL enable : at Server > Server manager > Server information > Edit Server Properties
Http bind port, Http bind configure : at Server > Server manager > System Properties
Custering (need to upgrade to Enterprise first) : at Server > Server manager > Clustering
Database stat : at Server > Server manager > Database
logs error : at Server > Server manager > logs

Connection manager : at Server > Server setting > Connection Managers
File transfer : at Server > Server setting > File Transfer Settings

Sunday, April 20, 2008

script run background

#!/bin/bash
echo $1
cp test.sh test2.sh
mv test.sh /tmp
java -version
echo "sang says => ${1}"
excommand="${1}"
eval $excommand



#!/bin/bash
excommand="nohup jab_simul.sh jab_simul_max${1}.xml"


#!/bin/bash
excommand="nohup /root/test2.sh jab_simul_max${1}.xml > test${1}.log &"
eval $excommand



#!/bin/bash
excommand="nohup /home/sang/jabsimul/jab_simul/jab_simul jab_simul_max${1}.xml > test${1}.log &"
echo $excommand
eval $excommand

#!/bin/bash
excommand="nohup /home/sang/jabsimul/jab_simul/jab_simul eidosimul_max${1}.xml > eitest${1}.log &"
echo $excommand
eval $excommand


ยังงี้ก็ไม่ต้องเปิดหน้าต่างเยอะๆแล้ว


มี tip ถ้าเรารันปกติเราใช้ Ctrl^Z ในการส่งมันไป background ได้
แล้วพิมพ์ fg ก็กลับมาที่ UI ปกติได้

Thursday, April 10, 2008

Connection manager ของ openfire

Me and Tae can setup "Connection manager" to connect to openfire one step completed.
As it, We still cannot setup http-bind to work in Connection manager. however, It's not depend on load test with jabsimul (./jab_simule) which noneed of http-bind.

So I need to post latest result of this testing.

Openfire server is install in 2 Core 2 Duo CPU Xeon 2.8GHz and 2GB Ram..
which assigned Java VM memory maximum is 1 GB

Connection manager installed in same server and assigned memory 1 GB to it.. so CM is very load this server

My 2 Computer, 1 PC Desktop run Fedora Core8 in VMWare 2GB Ram and 1 Notebook Toshiba Core2 Duo 1.8GHz 1.5 GB Ram. They can simulate 35,000(36,000) concurrent user which do event signin and send message every minutes...

I have to seperate jabsimule to run only 2,000 concurrent user in each terminal instant because I have found that if you run more than 4000 user, jabsumul will fail with error "segmentation fault" which i don't know what it is.

So, My notebook can run only 12 instant of jab_simul and then it have very slow action in windows.. 6 instant can run on PC and work properly

In case you would like to use CM in same server , you need to configure 5222 port of openfire to be not confilc with CM listen port (5222 to) you can change it in CM or change listen port on Openfire .. To test with jab_simule you need to change openfire listen port..

Without CM, 1 GB of openfire can support 35,000 completly and No delay !!

But with Connection manager, openfire can support 35,000 too but it have more delay times.. I test it by try connecting to openfire with PSI and chat between user..

So.. I forget to tell about CM setting

1.In case install it in same server, You need to change port at server>Edit properties (Button)
Tae and I changed "Client Port:" and "Client SSL Port: " to other port and let 5222 to listen by CM.

2. You have to setup password for CM to connect to openfire in tab in the left "Server setting">"connection manager"
Chnage to enable it and fill the password in and save

3. Go to CM directory by terminal, then go to ./conf/manager.xml set this field as below

- domain
- port
- password
- connections , if you have more than one CM you should change this field as id number of CM

- socket - default port 5222 => you should let it be the same
- ssl - as defalut port too

4. then to run it and assign java memory, you can config run script in ./bin or directly call java -jar as below

java -Xms512m -Xmx768m -jar ../lib/startup.jar

hope it useful for someone...

ว่าด้วยตัว test jabber (ต่อ2) เพิ่ม memory ให้ openfire

เพิ่มเติมการเพิ่ม memory ให้ openfire จะมีอะไรนิดหน่อยที่ บางทีมันไปเปลี่ยนตามที่ตั้งไว้ใน file
ไม่รู้เพราะต้อง restrat server หรืออย่างไร แต่ถ้า restart server ไม่ได้ เราก็ต้องเข้าไปแก้ตรงๆที่ script openfire.sh
ซึ่งอยู่ใน directory ที่เรา setup openfire เอาไว้ ในที่นี้ผมอยู่ที่ /opt/openfire/bin

แก้ตามนี้
http://www.igniterealtime.org/community/message/167950
/opt/openfire/bin/openfire.sh ==> vi it and goto
line

OPENFIRE_OPTS="${OPENFIRE_OPTS}
-DopenfireHome=${OPENFIRE_HOME}"

then
change to..

OPENFIRE_OPTS="-Xms1024m -Xmx2048m
-DopenfireHome=${OPENFIRE_HOME}"


เป็นการแก้แบบขอไปทีแต่ก็ได้ผล ส่วนใน windows วิธีที่สร้าง file properties นั้นใช้ได้ดีเลยไม่ได้หาวิธีแก้แบบขอไปที
บน windows เค้าทำเป็น exe มาแล้วด้วย ถ้าจะทำคงยากหน่อย

ลองทำแล้วครับ บน windows ให้สร้าง config file 2 ตัวน่ะ
ตามนี้

http://www.igniterealtime.org/community/message/151499

If you are using windows, in the bin folder under your openfire
directory,
you need to create/edit 1 of two files.
If running via the GUI console, create/edit the file

''openfired.vmoptions''.

In this file, add the following lines...

-Xms512m
-Xmx1024m

If you are running as a service,
copy the file to another file named,

''openfire-service.vmoptions''.

Hope this helps.

Message was edited by: ldove



มีอีกเรื่องที่เจอวันนี้ Tom run openfire server ในแบบ service ดังนั้นเวลา restart จะเรียกโดย
ผ่าน service

$> service openfire restart


การแก้ momory แบบเดิมจะไม่เปลี่ยน ต้องไปแก้ที่ /etc/sysconfig/openfire ตามนี้

Greetings,

Add a line like this in /etc/sysconfig/openfire

OPENFIRE_OPTS="-Xms256m -Xmx512m"

daryl


เอา mem เท่าไรก็ใส่ไป ได้ผลสำหรับ service ครับ

Thursday, April 03, 2008

ว่าด้วยตัว test jabber ต่อ

jabber simul ก็ใช้ได้ง่ายดีนะ

ค่า config ให้ดูในเว็บ เวลาไม่เอาเค้าใส่ตัว x ไว้หน้า tag ที่ไม่ใช้เฉยๆ
ดูจากใน example ได้

แต่ที่จะจดไว้คือ
เราต้องอย่าลืมเพิ่ม limit การเข้าถึง file i/o ด้วยคำสั่ง
และเพิ่มการจอง virtual memory ของ java ที่ใช้ run openfire

ulimit -n [จำนวน limit]

ผมนั่งๆกรอกดูว่ามันได้ค่ามากสุดเท่าไร เพราะทำเป็น unlimited ไม่เป็น ได้เป็นอย่างนี้ เกินกว่านี้ไม่ได้
ulimit -n 1048576

ถ้าจะดูว่า linux มัน limit อะไรได้มั่งก็ใช้คำสั่ง
ulimit -a

# ulimit -a
core file size (blocks, -c) 0
data seg size (kbytes, -d) unlimited
file size (blocks, -f) unlimited
pending signals (-i) 1024
max locked memory (kbytes, -l) 32
max memory size (kbytes, -m)
unlimitedopen files (-n) 1048576
pipe size (512 bytes, -p) 8
POSIX message queues (bytes, -q) 819200
stack size (kbytes, -s) 10240
cpu time (seconds, -t) unlimited
max user processes (-u) 8192
virtual memory (kbytes, -v) unlimited
file locks (-x) unlimited

มีคนเค้าเพิ่ม stack size ด้วยคำสั่ง ulimit -s 2048 หรือมากกว่านี้ด้วย

การเพิ่ม vm ทำได้โดยเพิ่ม parameter "-Xms1024m -Xmx2048m เพิ่มเป็น 2GB ไง
How to increase JAVA Memory in Openfire 3.3.2
http://www.igniterealtime.org/community/message/151499

How Do I Increase Java Memory?
http://www.igniterealtime.org/community/message/166435

สำหรับ linux
Add a line like this in
/etc/sysconfig/openfire

OPENFIRE_OPTS="-Xms256m -Xmx512m"

สำหรับ windows (โดนว่าๆไม่อ่านคู่มือ INSTALL ด้วยนิ)
If you are using windows,
in the bin folder under your openfire directory,
you need to create/edit 1 of two files.

If running via the GUI console,
create/edit the file ''openfired.vmoptions''.

In this file, add the following lines...-Xms512m-Xmx1024m

If you are running as a service, copy the file to another file named,
''openfire-service.vmoptions''.

Hope this helps.

Message was edited by: ldove

จากนั้นไปรัน jab_simul ใหม่
ผลที่ได้น่าจะรับ load ได้ดีขึ้น

DNS SRV

ย้อนนิดนึงก่อน
คราวก่อนได้เคยเขียนเรื่อง SVN Checkout ซึ่งเป็น tools ใช้ในการดูด code มาเป็น version คล้ายๆ CVS

อย่าสับสนกับ CSV นะ อันนั้นมันคือ comma spreaded value หรือ comma spreaded variable
เป็นการบอกว่าแบ่ง field ต่างๆของข้อมูลด้วยเครื่องหมาย คอมม่า (,) เฉยๆ ซึ่งถ้าเปิดด้วย excel ก็จะแบ่งเป็น col และ row ชัดเจนเหมือนเป็นไฟล์ excel ธรรมดา ที่ไม่มีกราฟหรือรูปหรือฟอร์แมตใดๆ

วันนี้อยากเขียนถึง SRV เพราะเกิดอาหารลืมเล็กน้อย มันคืออะไร
ดูข้อมูลจาก

http://en.wikipedia.org/wiki/SRV_record#Load_balancing_with_SRV
http://www.voip-info.org/wiki-DNS+SRV

ก็จะรู้ว่ามันคือ Record นึงใน DNS หรือ Domain Name Server นั่นเอง
DNS มันจะทำหน้าที่ Resolve จาก Name มาเป็น IP ให้ได้ จากคำถามว่า Domain นั้นอยู่ไหน
(ในทางกลับกันก็น่าจะได้ ต้องไปดูเรื่อง DNS ต่อนะครับ)
มันจะดูว่าตัวเองรู้จักไหมเป็นเจ้าของ host นั้นที่ต้องการไหม หรือมีสิทธิ์ในการตอบคำถามนั้นหรือเปล่า
ถ้ารู้ก็ตอบเลย แต่ถ้าไม่รู้จะมีสองวิธี
โดยการถามต่อให้ทราบว่า package ที่เข้ามาจะต้องไปทางไหนต่อ จาก DNS ที่อยู่สูงขึ้นไปให้เอง เสียสละสุดๆ
หรือแค่บอกทางที่จะต้องไปถามต่อเองก็ได้ คือบอกตำแหน่งของ DNS ตัวนั้น ก็ชี้บอกทางเหมือนเราถามทาง คนข้างทางคงไม่ไปส่งเราถึงที่ถูกไหม

มันเรียนรู้โดยเก็บไว้เป็น Record
ตอนเรียนเราเรียนแค่ A กะ MX (ที่จริงน่าจะมากกว่านี้ แต่ที่ยังหลงเหลือในความทรงจำโดยไม่ต้องเปิดอ่านมีเท่านี้หละ)

A คือ host
MX คือ mail

เอ้อมีเรื่อง CNAME อะไรอีกนี่หละ ต้องไปหา wiki มาเพิ่ม

SRV ก็คืออีกชนิดนึงของ Record เข้าใจว่าไว้ทำพวก load balance ได้ โยจะ redirect ไปยังเครื่องที่ควรจะไปได้

มี Format แบบเนี้ย

An SRV record has the form:

_Service._Proto.Name TTL Class SRV Priority Weight Port Target

Service: the symbolic name of the desired service.
Proto: the protocol of the desired service; this is usually either TCP or UDP.
Name: the domain name for which this record is valid.
TTL: standard DNS time to live field.
Class: standard DNS class field (this is always IN).
Priority: the priority of the target host, lower value means more preferred.
Weight: A relative weight for records with the same priority.
Port: the TCP or UDP port on which the service is to be found.
Target: the canonical hostname of the machine providing the service.

An example SRV record might look like this using bind syntax:

_sip._tcp.example.com. 86400 IN SRV 0 5 5060 sipserver.example.com.

Or like this using djbdns syntax:

S_sip._tcp.example.com:::5060:5:0:86400:

This points to a server named sipserver.example.com listening on TCP port 5060 for SIP protocol connections. The priority given here is 0, and the weight is 5.

As with PTR records, SRV records must point to the canonical name of the host. Aliases or CNAMEs cannot be used as valid targets.

ก็ยังไม่รู้อยู่ดีว่าจะ setup connection manager สำหรับ openfire ยังไงอะ

j2me jabber

เรื่องก๊อบชาวบ้านน่ะถนัด
เนื่องจากเราก็ต้องดู client บน java phone ไปด้วย 555 หาข้อมูลมากองเอาไว้ก่อนนะคร้าบ

จากที่นี่
http://j2me.ngphone.com/opensource/imp2p.htm

GTMobile
GTMobile is a client of Google Talk that run on java phones. It requires CLDC 1.1 and MIDP 2.0 support.
URL
http://code.google.com/p/gtmobile
License
Apache License 2.0
Jimm
Jimm is an ICQ clone for mobile devices, such as celluluar phones. It is written in Java 2 Micro Edition (MIDP) and uses protocol version 8. Jimm is not affiliated with or endorsed by ICQ, Inc.
URL
http://jimm.sourceforge.net
License
GNU General Public License (GPL)
JimmyIM
JimmyIM is an open-source mobile IM client that supports simultaneous connections to multiple networks & protocols. So far, three protocols have been implemented: MSN, Jabber/Google talk and ICQ. The next step will be Yahoo protocol implementation.
URL
http://jimmyim.berlios.de
jmIrc
jmIrc aims to be as small and lightweight as possible still trying to maintain the ease of use and all needed features.
URL
http://jmirc.sourceforge.net
License
GNU General Public License (GPL)
JXME - Project JXTA for J2ME
Project JXTA (stands for Project Juxtapose) is an open network programming platform to enable P2P services and applications. The purpose of project JXTA for J2ME (JXME) is to provide JXTA compatible functionalities on constained devices using CLDC and MIDP 2.0. Using JXTA for J2ME, any MIDP device is able to participate in P2P activities with other MIDP devices. At the same time, a MIDP device is able to participate, with some restrictions, in P2P activities with JXTA peers running on desktops/workstations/servers.
URL
http://jxme.jxta.org
License
The Sun Project JXTA Software License
Related Article(s)
[Sun Developer]Getting Started with JXTA for J2ME
[IBM Developer Works]Wireless messaging with JXTA, Part 1: Using JXTA technology
[IBM Developer Works]Mobile P2P messaging, Part 2: Develop mobile extensions to generic P2P networks
k-IRC
k-IRC is totally free java-based mobile application (client) for connecting to any IRC server. It will execute on any handheld device or mobile, supporting Java 2 Micro Edition (actually CLDC1.0/MIDP1.0).
k-IRC allows you to login to an IRC server, enter multiple channels at the same session, talk in the channels and with individuals and receive others' messages and easily keep the track of active channels and switch between them.
URL
http://kirc.sourceforge.net
License
GNU General Public License (GPL)
kvmjab - Java JVM/KVM Jabber Client Library
A Library for communicating with the Jabber Instant messaging system from either Java 2 Standard Edition or Micro Edition.
URL
http://sourceforge.net/projects/kvmjab
License
BSD License
MGTalk - Google Talk for mobile
MGTalk is Jabber client for j2me midp 2.0 platform (midlet), supports some Google Talk features. May run on any j2me midp 2.0 mobile phone or communicator.
URL
http://sourceforge.net/projects/mgtalk/
License
GNU General Public License (GPL)
MiniIM
MiniIM is a multi-protocol instant messaging client. It is inspired by one of such popular software Pidgin(Gaim). The design is concentrated on the protocol level abstraction and an easy way to integrate new protocol implementations. You can use this client to chat with yahoo/msn/icq/aol contacts.
URL
http://miniim.sourceforge.net
License
GNU General Public License (GPL)
mobile-google-talk-http
mobile-google-talk-http is an extension of the MGTalk J2ME application to support the HTTP Binding (JEP-124). The original MGTalk application is a well-done Jabber client for J2ME. It also supports some Google Talk specific features. However, it does not support an HTTP communication mechanism for Jabber (a.k.a HTTP Binding or JEP-124).
URL
http://code.google.com/p/mobile-google-talk-http
License
GNU General Public License 2.0
Mobber
Mobber is a mobile communicator based on the Jabber protocol for cell phones with GPRS. It is written in java (MID Profile Version 1.0) - should work on any device that supports Java (it was tested on Siemens CX65 and phone emulators available for Linux).
URL
http://mobber.gryf.info/
License
GNU General Public License (GPL)
Valhalla Chat
Valhalla Chat is a Bluetooth Instant Messenger (IM), that provides a common messaging platform for mobile phones, desktop computers and PDA's.
URL
http://www.valhallachat.com
License
GNU General Public License (GPL)
Virca
Another IRC MIDP client.
URL
http://www.vidarholen.net/contents/virca
License
GNU General Public License (GPL)
WLIrc
WLIrc is a IRC Client for Java cell phones or any other devices which support java MIDP 1.0.
URL
http://wirelessirc.sourceforge.net
License
GNU General Public License (GPL)

=============================

นอกนั้นตอน search google ก็มีให้ดูเหมือนกัน

http://www.google.co.th/search?hl=th&q=j2me+lib+jabber&meta=


Java ME Open Source Software - Instant Messenger (IM), IRC, ICQ ...
A Library for communicating with the Jabber Instant messaging system from either Java 2 ... MGTalk is Jabber client for j2me midp 2.0 platform (midlet), ...j2me.ngphone.com/opensource/imp2p.htm - 16k - หน้าที่ถูกเก็บไว้ - หน้าที่คล้ายกัน

Jabber Mix Client
It is based on J2ME (MIDP 2.0, CLDC 1.1/1.0) and the MicroJabber library (http://micro-jabber.sourceforge.net/) which I have modified and upgraded to fit ...jabbermixclient.sourceforge.net/ - 11k - หน้าที่ถูกเก็บไว้ - หน้าที่คล้ายกัน
[PDF]

JABBER MIX CLIENT
รูปแบบไฟล์: PDF/Adobe Acrobat - แสดงเป็นแบบ HTMLJabberMixClient (JMC) is an Instant Messaging client for Jabber protocol for portable devices. It is. based on J2ME (MIDP 2.0) and the MicroJabber library ...jabbermixclient.sourceforge.net/JMC_UserManual.pdf - หน้าที่คล้ายกัน

[JDEV] ANN: Smack -- Open Source Java Jabber library
Previous message: [JDEV] ANN: Smack -- Open Source Java Jabber library ... Smack is not designed to be J2ME compatible although it probably wouldn't be ...mailman.jabber.org/pipermail/jdev/2003-January/014581.html - 5k - หน้าที่ถูกเก็บไว้ - หน้าที่คล้ายกัน

Creating an IM Client in Jabber using J2ME - Developer Discussion ...
Is there a library for J2ME for interacting with a jabber server? Is there a particularly good open-source jabber client written in J2ME? ...discussion.forum.nokia.com/forum/showthread.php?t=112259 - 53k - หน้าที่ถูกเก็บไว้ - หน้าที่คล้ายกัน

Jabber Open Source Client Library with File Transfer Functionality ...
Does anyone know of an open source jabber client library for J2ME that has file transfer implemented aswell. Im aware of many J2ME jabber client libraries ...discussion.forum.nokia.com/forum/showthread.php?t=113492 - 49k - หน้าที่ถูกเก็บไว้ - หน้าที่คล้ายกัน

mix client เหรอ น่าดูแฮะ

ถ้า smack support j2me ก็ดีนะ เพราะมันดูมีการ update พอสมควร มันเป็นจ้าวเดียวกับ jive มั้ง ที่ดูแล openfire
คุ้นๆชื่อว่าเคยเห็นบ่อยๆ

=================

http://www.jabber.org/clients

หน้าหลักของ jabber ทำใหม่เป็น dropdown ดูดีขึ้น แต่ search ก็ยังยากอยู๋ดี เลือกไปไม่ค่อยเจอ

คงกลางๆเดือนได้เริ่มดู ช่วงนี้ก็ load test openfire อยู่ครับ

Tuesday, April 01, 2008

ลงตัว test jabber openfire

ทีแรกไปดู document เกี่ยวกับปริมาณโหลดสูงสุดของ openfire มันสามารถรับ user ได้มากถึงแสนคน (concurrent)
โดยมีตัวช่วยกระจายโหลด คือ connection manager เป็น app แยกออกมาช่วยจัดการในวงเล็กก่อน forward ต่อไปที่ openfire ตัวหลักตาม info นี้ http://www.igniterealtime.org/projects/openfire/connection_manager.jsp

1 connection manager ตีได้ว่ารองรับได้ 25,000 concurrent transaction นะ
เค้าแบ่งตามการ test ไว้ตามนี้
Hardware Recommendations

Concurrent Users Recommendation
1-500 At least 384 MB of available RAM and one 1.5 GHz processor.
501-10,000 At least 768 MB of available RAM and one 3.0 GHz processor.
10,001-25,000 At least 1.5 GB of available RAM, two 3 GHz processors,
and one connection manager on the same machine.
25,001-100,000 At least 2.0 GB of available RAM, two 3 GHz processors,
and between 1 and 4 connection managers based on exact size,
each on their own equivalent machine.

การเพิ่ม load จะเป็นผลพลอยได้จากการทำ cluster ได้ด้วย ที่จริงน่าจะทำไปเพื่อลด downtime เป็น backup system มากกว่า
info ที่นี่ http://www.igniterealtime.org/community/docs/DOC-1471 และ http://www.igniterealtime.org/community/docs/DOC-1260 และ http://www.jivesoftware.com/products/openfire/features/clustering.jsp อันหลังไม่ค่อยมี info อะไน

คิดราคาตามนี้ http://www.jivesoftware.com/pricing/

กลับมาเรื่อง test ทาง igniterealtime แบ่งทีม QA มาโดยเฉพาะ ชื่อว่า QA Ninjas ชื่อเท่ห์ดีจัง
http://wiki.igniterealtime.org/display/NINJA/QA+Ninjas+Overview
http://wiki.igniterealtime.org/display/NINJA/Tsung+Tests
ในช่องของ Load test มีตัวที่ผมสนใจก็คือ TSung เพราะใน document ของ openfire เกี่ยวกับปริมาณหารโหลด เป็น pdf file จำไม่ได้แล้วว่า link ไหน เขียนไว้ว่าใช้ Tsung ในการทดสอบ และแสดงผลออกมาเป็นกราฟได้ เท่าที่เรียนมากการวัดประสิทธิภาพ ถ้าโปรแกรมทำให้เป็นกราฟได้จะดีมาก เพราะวัดผล เปรียบเทียบกันง่าย.. แต่วันก่อนคุยกะ tom ทอมบอกไม่ได้ต้องการขนาดนั้น

เพราะลง Tsung ไม่ได้ซักที ติดเรื่อง ODBC เพราะ Elang OTP มันมองไม่เห็น ODBC ที่ลงไว้ซักที ลงเองก็ไม่ค่อยเป็น เพราะลงจาก rpm มีปัญหาหรือเปล่าก็ไม่รู้เหมือนกัน เลยใช้ edit ไปที่ file odbc.ini แล้วก็ odbcinst (มั้ง) ตาม link นี้ เขียน info ไว้ดีทีเดียว เกี่ยวกับ odbc บน linux http://www.easysoft.com/developer/interfaces/odbc/linux.html
คำสั้งที่ได้ใช้ไป

[root@localhost jab_simul]# odbcinst -j
unixODBC 2.2.11
DRIVERS............: /etc/odbcinst.ini
SYSTEM DATA SOURCES: /etc/odbc.ini
USER DATA SOURCES..: /root/.odbc.ini

แก้ไข odbcinst.ini
# Example driver definitinions#
#
# Included in the unixODBC package
[PostgreSQL]
Description = ODBC for PostgreSQL
Driver = /usr/lib/libodbcpsql.so
Setup = /usr/lib/libodbcpsqlS.so
FileUsage = 1

# Driver from the MyODBC package
# Setup from the unixODBC package
[MySQL]
Description = ODBC for MySQL
Driver = /usr/lib/libmyodbc.so
Setup = /usr/lib/libodbcmyS.so
FileUsage = 1

แก้ไข odbc.ini
[ODBC_datasource_name}
Driver = driver_name
Description = description_of_data_source
attribute1 = value
.
.
attributen = value

ผมใช้ odbc source ที่มี installer ทดสอบดูด้วยว่า มองเห็นไหม ก็มองเห็นดีนี่นา
mysql-connector-odbc-5.1.3-rc-linux-x86-32bit/bin/myodbc-installer -d -l
PostgreSQL
MySQL

ทดสอบว่า connect ผ่าน odbc ได้
isql -v DSN_NAME db_username db_password


แต่พอสั่ง ./configure ใน source ของ otp_src_R12B-1 ของ elang ก็เจ๊งอยู่ดี
มันจะขึ้น error ในตอนท้ายว่า ODBC library - link check failed

ที่จริงผมลง unixODBC พร้อม mysql มาตั้งแต่ install Redhat แล้ว แต่ version มันต่ำไปหน่อย mysql version 4 เอง ก็เลยถูกสงสัยว่าเป็นเพราะ version ไม่ compat กันหรือยังไงกับ otp ลงใหม่เป็น version 5 ก็ได้ info จาก link นี้ http://somdej17.moph.go.th/hosxp/hosxp_help/Wcf054208e7f86.html
ก็เป็นการ force ให้ลงทับโดยไม่สนใจ depandency คงประมานนั้นด้วย option nodeps
rpm -ivh MySQL-shared-5.0.37-0.glibc23.i386.rpm --nodeps --force
rpm -ivh
MySQL-client-5.0.37-0.glibc23.i386.rpm --nodeps --force
rpm -ivh
MySQL-server-5.0.37-0.glibc23.i386.rpm --nodeps --force


พยายามแก้ไข my.cfg แต่ไม่สำเร็จ กลายเป็น start mysql ไม่ได้
เลยแก้กลับเป็น my.cfg แบบ default

ทำอยู่นานสรุปว่าไม่ได้อะไร หมดหนทางลง tsung
ลอง search ใหม่ ได้หน้านี้มา http://www.ejabberd.im/benchmark มันคือ jabsimul ไว้ทดสอบ ejabberd
ทีแรกหาที่ downlaod ไม่ได้.. ที่จริง เราสามารถใช้ linux command (cvs หรือ wget) download ได้เลย
ตามนี้ยกมาบางส่วน
แก้ config ของ linux ละมั้ง
ulimit -n 16000

ดาวน์โหลดมาเลย make อย่างไงไปดูเอาเอง
cvs -z3 -d:pserver:anonymous@jabbertest.cvs.sourceforge.net:/cvsroot/jabbertest co testsuite

สั่งรันสร้าง user ที่ server ลองแล้วเปลี่ยนไปเป็น openfire ก็ได้ผลเหมือนกัน
./userreg -h localhost -u 3000 -n 1

จากนั้นลง jabsimul
wget http://www.ejabberd.im/files/other/jabsimul.tar.gz
tar xzf jabsimul.tar.gz
cd jabsimul/jab_simul/
cp jab_simul.xml.example jab_simul.xml
./configure
make

สั่ง run จริงๆต้องแก้ jab_simul.xml ก่อน แต่ลองทำไปโดยไม่แก้เพื่อดูผล
./jab_simul

ผลคือมันมีตัวเลขวิ่งๆ เป็น text based น่าจะใช้ได้นะ ลงไม่ยากเท่าไรด้วย
วันนี้จะลองแก้ไข xml config นี้แล้วค่อนรันดู เรื่อง connection manager คงยังไม่ได้ไปทำอะไรมัน