1 / 23

jbox

jbox. A Java Server Appliance Michael Ringgaard (mringgaa@csc.com) Bjarne Hansen (bhansen4@csc.com) http://www.jbox.dk. Welcome & Agenda. Welcome Bjarne Hansen, bhansen4@csc.com Computer Sciences Corporation Michael Ringgaard, mringgaa@csc.com Computer Sciences Corporation Agenda

danyl
Download Presentation

jbox

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. jbox A Java Server Appliance Michael Ringgaard (mringgaa@csc.com) Bjarne Hansen (bhansen4@csc.com) http://www.jbox.dk

  2. Welcome & Agenda • Welcome • Bjarne Hansen, bhansen4@csc.com Computer Sciences Corporation • Michael Ringgaard, mringgaa@csc.comComputer Sciences Corporation • Agenda • What is a jbox? • Why would we want a jbox? • What can a jbox be used for? • Inside the jbox...

  3. What is a jbox? • A server appliance for Java programs • Requires only power and a network connection • No monitor, keyboard, or mouse • Built for standard Intel based PC • Cheap, simple and powerful • Runs only one process: the Java VM • Specifically the HotSpot Java VM for Windows • Relies on a small and efficient kernel • Transforming application servers to appliances Web applications J2SE, J2EE, ... Java VM OS kernel

  4. Appliances in general… • Characteristics of appliances • Unpack, connect, use... • Can’t rely on experts to operate .. • Must require just about zero maintenance • Would be nice characteristics for an IT business system! • By the way...next generation of home appliances: Broadband router, DHCP, DNS,...

  5. Why a Java Appliance? • We need a minimalistic yet effective platform for... • Development • Deployment • Management • Maintainance • Cost effective platform • Cheap hardware • Develop on PC, deploy to appliance • Wide selection of development environments, tools, and utilities • Easy to manage and maintain • Flexible scaling of configuration • Java is a powerful and rich environment yet simple enough for an appliance

  6. What can a jbox be used for? • What would we like to achieve? • Apply the virtues of traditional appliances to IT business systems • Apply the effective software development tools, utilities, and methodologies to appliance development • When using a jbox as... • ...a Java server applianceIdeal development environment to develop, deploy and maintain software for appliances • ...a Java cluster nodeIt’s better to own 100 appliances than 100 application servers

  7. standard appliance standard appliance standard appliance J2SE, J2EE, ... J2SE, J2EE, ... J2SE, J2EE, ... Java VM Java VM Java VM OS kernel OS kernel OS kernel As a Java Server Appliance J2EE application Web application Web application Fast, effective deployment of new solution!

  8. JMX JMX firewall firewall ... DNS DNS DHCP DHCP SAN ... NAS UPS UPS As Java Cluster Nodes

  9. Clusters of Appliances • Clustering support is a feature of specific J2EE server products • Focus on transparency (developer, user) • No architecture support for clustering • Clustering is hard to configure and maintain • Custom designed distributed architectures • J2EE+, Jini, JavaSpaces, P2P, JXTA, ... • Automatic deployment in clusters • Built in JMX support for management • Who should we learn from? • google.com – the best performing and most scalable search engine ever…based on thousands of server appliances… • …and KaZaA, Napster, Games…

  10. Appliance Management • Standalone appliances can be managed using web interface • Most J2EE servers has built-in web based management consoles • Appliance clusters requires special attention on deployment and configuration issues • How do you deploy applications to many nodes • Centralized application and configuration repository (JMX). • Each server appliance only contains a “cached” version of its own configuration • Central management of applications executing on one or more appliances • Take individual boxes up/down • Manage applications, not servers

  11. Stop!...What about the customers? • Customers wants • Performance, scalability, security, and business agility • "3-tier Architecture" solutions • Offered by CSC and our competitors alike • Hosting offerings based on 3-tier architectures are becomming commodities • We solve complex business problems for our clients • We need to be in the high-end market • But we must be able to provide cost effective solutions • CSC offerings for managed eSolutions • Takeoff in less that 2 days... • Custom distributed solutions that fits customer needs... • Second to none managable solutions... • Quick and painless hosting and problem resolution... • ONE CSC

  12. What should be the CSC differentiating factor? • When offering custom solutions we must... • offer solutions that fits the problem • offer unique solutions (differentiate from competition) • cut through "enterprise" buzz words hype • At the same time we must be cost-effective • low-cost infrastructure components • scalable architecture • efficient development environment • manageable applications • efficient problem resolution • rapid development life-cycle

  13. CASE: http://www.degulesider.dk • Solution requires • Searching: Name, number, address, company, trade, ... • Route planning and maps • Travel plans • Massive usage of profiling and banner ads • Current solution • Huge Sun boxes • Extremely expensive Oracle license (Board decision) • Performance and scalability issues • Architectural issues related to flexibility • Solution • Flexible distributed application clusters for handling each solution component • Massive caching (most data is next-to-read-only) • Customized streaming • Scalable with number of servers in each application cluster

  14. jbox Inside the jbox...

  15. Features • A kernel for executing Java server applications on appliances • Runs on standard PC hardware (IA-32) • Uses existing HotSpot VM • Small, simple, fast but complete kernel • Developed using Microsoft Visual C • Uses standard EXE/DLL executables

  16. Architecture app Java server application (e.g. tomcat, jboss) sdk Java 2 SDK (rt.jar, tools.jar) HotSpot VM jvm.dll java.dll jvm net.dll zip.dll verify.dll hpi.dll wsock32.dll winmm.dll msvcrt.dll win32 jinit.exe user32.dll advapi.dll kernel32.dll os.dll kernel sanos krnl.dll osldr.dll boot boot

  17. 194 Windows API calls used KERNEL32 CloseHandle CreateEventA CreateFileA CreatePipe CreateProcessA CreateSemaphoreA DebugBreak DeleteFileA DisableThreadLibraryCalls DuplicateHandle EnterCriticalSection FindClose FindFirstFileA FindNextFileA FlushFileBuffers FormatMessageA FreeLibrary GetCurrentDirectoryA GetCurrentProcess GetCurrentThread GetCurrentThreadId GetEnvironmentVariableA GetExitCodeProcess GetFileAttributesA GetLastError GetLogicalDrives GetModuleFileNameA GetNumberOfConsoleInputEvents GetProcAddress GetStdHandle GetSystemDirectoryA GetSystemInfo GetSystemTime GetSystemTimeAsFileTime GetTempPathA GetThreadContext GetThreadLocale GetThreadPriority GetThreadTimes GetTimeZoneInformation GetVersionExA GetWindowsDirectoryA InitializeCriticalSection InterlockedDecrement InterlockedIncrement IsDBCSLeadByte LeaveCriticalSection LoadLibraryA PeekConsoleInputA PeekNamedPipe QueryPerformanceCounter QueryPerformanceFrequency ReleaseSemaphore RemoveDirectoryA ResetEvent ResumeThread SetConsoleCtrlHandler SetEndOfFile SetEvent SetFileAttributesA SetFilePointer SetFileTime SetHandleInformation SetThreadContext SetThreadPriority Sleep SuspendThread SystemTimeToFileTime TerminateProcess TlsAlloc TlsGetValue TlsSetValue VirtualAlloc VirtualFree VirtualQuery WaitForMultipleObjects WaitForSingleObject WideCharToMultiByte USER32 MessageBoxA ADVAPI32 GetUserNameA RegCloseKey RegEnumKeyExA RegOpenKeyExA RegQueryInfoKeyA RegQueryValueExA WSOCK32 __WSAFDIsSet accept bind closesocket connect gethostbyaddr gethostbyname gethostname getprotobyname getsockname getsockopt htonl htons ioctlsocket listen ntohl ntohs recv recvfrom select send sendto setsockopt shutdown socket WSACleanup WSAGetLastError WSAStartup MSVCRT new delete __dllonexit __mb_cur_max _access _adjust_fdiv _assert _beginthreadex _CIfmod _close _control87 _endthreadex _errno _except_handler3 _finite _fstati64 _ftol _fullpath _get_osfhandle _getdcwd _getdrive _initterm _iob _isctype _isnan _lseeki64 _mkdir _onexit _open _open_osfhandle _pctype _purecall _read _setjmp3 _setmode _stat _stati64 _strdup _vsnprintf _write abort atof calloc exit fclose fflush fgets fopen fprintf fputc free getc getenv isalnum isspace longjmp malloc memmove printf putchar qsort raise realloc rename signal sprintf sscanf strchr strerror strncmp strncpy strrchr strstr strtol toupper vfprintf vsprintf WINMM timeEndPeriod timeBeginPeriod timeGetTime

  18. sanos API socket thread critsect resolver file beginthread endthread epulse ereset eset getcontext getprio gettib gettid mkevent mksem resume self semrel setcontext setprio sleep suspend wait waitall waitany csfree enter leave mkcs dn_comp dn_expand res_mkquery res_query res_querydomain res_search res_send accept bind connect getpeername getsockname getsockopt listen recv recvfrom send sendto setsockopt shutdown socket canonicalize chdir chsize close dup flush format fstat fstatfs futime getcwd getfsstat ioctl link lseek mkdir mount open opendir read readdir readv rename rmdir stat statfs tell umount unlink utime write writev tls tlsalloc tlsfree tlsget tlsset netdb gethostbyaddr gethostbyname gethostname getprotobyname getprotobynumber getservbyname getservbyport inet_addr inet_ntoa heap calloc free mallinfo malloc realloc time clock gettimeofday settimeofday time module system memory exec getmodpath getmodule load resolve unload config dbgbreak exit loglevel panic peb syscall syslog mlock mmap mprotect mremap munlock munmap

  19. Files sanos java tomcat /os: krnl.dll 184.0 KB 3c905c.sys 13.4 KB os.dll 35.4 KB sh.exe 22.0 KB jinit.exe 6.4 KB msvcrt.dll 18.4 KB kernel32.dll 18.4 KB user32.dll 2.4 KB advapi32.dll 4.4 KB wsock32.dll 5.0 KB winmm.dll 2.4 KB /etc: krnl.ini 0.5 KB os.ini 1.7 KB /usr/java/bin/hotspot: jvm.dll 648.0 KB /usr/java/bin: hpi.dll 28.0 KB java.dll 88.0 KB net.dll 32.0 KB ioser12.dll 24.0 KB jpeg.dll 108.0 KB zip.dll 52.0 KB verify.dll 52.0 KB jcov.dll 40.0 KB hprof.dll 44.0 KB /usr/java/lib: rt.jar 12811.4 KB i18n.jar 2576.8 KB tools.jar 4535.2 KB sunrsasign.jar 84.2 KB tzmappings 6.3 KB content-types.properties 5.3 KB /usr/java/lib/security: cacerts 7.1 KB java.policy 2.1 KB java.security 3.8 KB /usr/tomcat/lib: webserver.jar 420.3 KB servlet.jar 39.8 KB jasper.jar 212.8 KB jaxp.jar 5.4 KB parser.jar 132.9 KB /usr/tomcat/conf: server.xml 9.0 KB tomcat-users.xml 0.2 KB /usr/tomcat/webapps: admin.war 6.3 KB examples.war 112.5 KB root.war 430.8 KB test.war 85.1 KB

  20. Sanos Configuration /etc/krnl.ini /etc/os.ini [kernel] libpath=/os keyboard=dk [bindings] pci class 060100=krnl.dll!install_isapnp isa class 0700**=krnl.dll!install_serial isa unit 6D08D041=ne2000.sys isa unit 19808C4A=ne2000.sys pci unit 10222000=pcnet32.sys pci unit 10B79200=3c905c.sys pci unit 10B79050=3c905c.sys pci unit 10B79055=3c905c.sys [drivers] krnl.dll!install_null krnl.dll!install_console [os] libpath=c:\\os initpgm=c:\\os\\jinit.exe user=root hostname=sanos logfile=/dev/syslog [java] jvm=c:\\usr\\java\\bin\\hotspot\\jvm.dll mainclass=org.apache.tomcat.startup.Tomcat [java.options] -Xmx256M [java.properties] user.timezone=Europe/Copenhagen tomcat.home=c:\\usr\\tomcat [java.classpaths] c:\\usr\\java\\lib\\tools.jar c:\\usr\\tomcat\\lib\\webserver.jar c:\\usr\\tomcat\\lib\\servlet.jar c:\\usr\\tomcat\\lib\\parser.jar c:\\usr\\tomcat\\lib\\jaxp.jar c:\\usr\\tomcat\\lib\\jasper.jar

  21. Where is the code? sanos kernel (40 KLOC) 2% HotSpot VM (235 KLOC) 12% J2SE Native (415 KLOC) 21% J2SE Java (1277 KLOC) 65% KLOC = Kilo Lines Of Code

  22. Performance Remember that there is no code faster than no code. Taligent's Guide to Designing Programs • It is the CPU that executes your application, not the operating system. • HotSpot VM is the same as on Windows. • Kernel services • Theading • Very fast context switching, sysenter/sysexit • No spin locks. • Memory • Most memory mangement done by the JVM. • Single process design uses CPU cache and TLB very efficiently. • Doug Lea's malloc is consistently among the fastest and most space-efficient implementations; in many cases it particularily excels at saving memory, where other allocators suffer from fragmentation. • Disk I/O • UDMA support. • Disk caching. • No overhead for legacy performance optimizations (cylgroups, read ahead, interleave etc.) • Network I/O • PCI bus mastering. • TCP/IP checksum offloading. • No-copy packet buffers.

  23. Conclusion • Is Java an operating system? • No, but if you add 2% to the code that is already there it can become an operating system! • Did we write our own operating system? • No, we only made the kernel, SUN did the remaining 98%! • sanos has been released as open source (BSD license) and is available for download at www.jbox.dk. • Demo athttp://20.45.153.241

More Related