<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-5477635599657734930</id><updated>2011-09-19T10:06:30.216-07:00</updated><category term='hpc'/><category term='IMDG'/><category term='reflection'/><category term='CLR'/><category term='scalability'/><category term='IceGrid'/><category term='newton'/><category term='definition'/><category term='monitoring'/><category term='Java'/><category term='distributed systems'/><category term='JAR'/><category term='data grid'/><category term='r-osgi'/><category term='speculation'/><category term='osgi'/><category term='dosgi'/><category term='dzen'/><category term='WMI'/><category term='JMX'/><category term='GigaSpaces'/><category term='GridGain'/><category term='compute grid'/><category term='performance counters'/><category term='reflexil'/><category term='ICE'/><category term='performance'/><category term='architecture'/><category term='profiling'/><category term='management'/><category term='.NET'/><title type='text'>Considered harmful</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://mcsimm.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5477635599657734930/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://mcsimm.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Max Martynov</name><uri>http://www.blogger.com/profile/12000269073735478943</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>10</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-5477635599657734930.post-515959737044310857</id><published>2009-10-13T06:18:00.000-07:00</published><updated>2009-10-13T12:24:46.067-07:00</updated><title type='text'>About MPI Send/Receive Deadlocks</title><content type='html'>In this post I will try to describe potential problems with synchronous Send/Receive communication primitives from MPI and how to resolve them. In particularly, I will talk about &lt;a href="http://www.osl.iu.edu/research/mpi.net/"&gt;MPI.NET&lt;/a&gt; implementation, but lessons can be applied to any implementation.&lt;br /&gt;&lt;br /&gt;Consider a simple MapReduce application. In this application main process sends N messages to M available processes and waits for results. There are no cyclic dependencies and reetrancy - just a flat model. So, the first intention is to use Send/Receive methods to organize message passing. To make things simple, assume there are only two processes (one main and one worker). So, the MPI program may look like the following:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&lt;span style=";font-family:courier new;"&gt;&lt;br /&gt;using (var env = new Environment(ref args))&lt;br /&gt;{&lt;br /&gt;   var comm = Communicator.world;&lt;br /&gt;&lt;br /&gt;   if (comm.Rank == 0)&lt;br /&gt;   {&lt;br /&gt;      for (var i = 0; i &lt; taskCount; i++) comm.Send(new byte[msgLen], 1, 1);&lt;br /&gt;      for (var i = 0; i &lt; taskCount; i++) comm.Receive(1, 1);&lt;br /&gt;   }&lt;br /&gt;   else if (comm.Rank == 1)&lt;br /&gt;   {&lt;br /&gt;      for (var i = 0; i &lt; taskCount; i++) &lt;br /&gt;      {&lt;br /&gt;         comm.Receive(0, 1);&lt;br /&gt;         comm.Send(new byte[msgLen], 0, 1);&lt;br /&gt;      }&lt;br /&gt;   }&lt;br /&gt;}&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Surprisingly, with small messages this program will work fine. However, trying to set msgLen to, for example, 1 MB will make program hang. Actually, this is expected behavior, because Send and Receive functions are supposed to be synchronous: Send function should wait for corresponding Receive function in another process. The biggest question is why it behaves differently for different message sizes. Answer comes from &lt;a href="http://www.mpi-forum.org/docs/"&gt;MPI specification&lt;/a&gt;:&lt;br /&gt;&lt;br /&gt;"&lt;span style="font-style:italic;"&gt;The send call described in Section 3.2.1 uses the standard communication mode. In this mode, it is up to MPI to decide whether outgoing messages will be buffered. MPI may buffer outgoing messages. In such a case, the send call may complete before a matching receive is invoked. On the other hand, buffer space may be unavailable, or MPI may choose not to buffer outgoing messages, for performance reasons. In this case, the send call will not complete until a matching receive has been posted, and the data has been moved to the receiver.&lt;/span&gt;"&lt;br /&gt;&lt;br /&gt;So, even if Send function are considered synchronous, there are more details hidden inside it. Interprocess communication types are not divided to only synchronous vs asynchronous. There are more different modes, and MPI Send function cover two modes at once. It is left to implementation to decide which mode to use in every concrete case. MPI.NET specification of Send method says the following:&lt;br /&gt;&lt;br /&gt;"&lt;span style="font-style:italic;"&gt;The basic Send operation will block until this message data has been transferred from value. This might mean that the Send operation will return immediately, before the receiver has actually received the data. However, it is also possible that Send won't return until it matches a Receive&lt;(Of &lt;(T&gt;)&gt;)(Int32, Int32) operation. Thus, the dest parameter should not be equal to Rank, because a send-to-self operation might never complete.&lt;/span&gt;"&lt;br /&gt;&lt;br /&gt;So, in some cases Send method is partially asynchronous, and these are the cases of small messages. Very interesting question is a threshold, when Send becomes fully synchronous and whether this threshold is fixed or environment-specific? It is pretty hard to find out an algorithm, because MPI.NET uses native code. After some experiments, I found out that in my environment it is a bit less than 128000 bytes of payload.&lt;br /&gt;&lt;br /&gt;Fixing this sample is very easy and straightforward - just replace Send with ImmediateSend and wait for asynchronous requests. However, it is important to remember not to rely on partially asynchronous behavior of Send primitive. Always test your MPI applications with different messages sizes and read documentation carefully.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5477635599657734930-515959737044310857?l=mcsimm.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mcsimm.blogspot.com/feeds/515959737044310857/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5477635599657734930&amp;postID=515959737044310857' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5477635599657734930/posts/default/515959737044310857'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5477635599657734930/posts/default/515959737044310857'/><link rel='alternate' type='text/html' href='http://mcsimm.blogspot.com/2009/10/about-mpi-sendreceive-deadlocks.html' title='About MPI Send/Receive Deadlocks'/><author><name>Max Martynov</name><uri>http://www.blogger.com/profile/12000269073735478943</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5477635599657734930.post-7301263214389571969</id><published>2009-08-01T01:18:00.000-07:00</published><updated>2009-08-01T05:33:41.697-07:00</updated><title type='text'>Distributed Excel or Excel on the Grid</title><content type='html'>It is a well known fact that Excel supports &lt;a href="http://msdn.microsoft.com/en-us/library/bb687899.aspx"&gt;multithreading workbook recalculation&lt;/a&gt; from the version 2007. However, even at an earlier time, there was a possibility to execute a workbook in a distributed way. Distributed calculation of Excel workbooks is not well integrated with Office and is not a seamless process, but the possibility still exists. Since it is not integrated with Office, external applications and frameworks are required. Typically, these external applications are computational grids, like &lt;a href="http://www.microsoft.com/hpc/en/us/default.aspx"&gt;Microsoft HPC Server&lt;/a&gt; or &lt;a href="http://en.wikipedia.org/wiki/Symphony_%28software%29"&gt;Platform Symphony&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;There are two approaches to execute Excel workbook on the grid in a distributed fashion. One approach is to use Excel as a UI for entering input data and displaying computation results. All computation logic is located in User Defined Functions (UDF) in external XLL or automation add-in libraries. Libraries are implemented in any appropriate language and platform. For XLL this can be C or C++, for automation add-ins this can be anything that supports COM, like C++ or .NET/C#/VB/F#. The approach with UDFs is pretty straitforward to implement. Developer has an API to a grid and she can easilly implement a logic of splitting big job into small tasks and submitting the tasks to a grid. To run a distributed computation, user of Excel worksheet just invokes the UDF with job input parameters. This approach is good for UDF developer, but very inconvinient for Excel worksheet user. The main disadvantage is narrow flexibility, lack of generic framework and inability to implement distributed computation in C/C++/.NET for Excel/VBA user.&lt;br /&gt;&lt;br /&gt;Luckily, there is another approach, when grids support executing Excel worksheets themselves on the cluster. In this case, a workbook contains both UI and computation logic in cell formulas or VBA. Almost all solutions support distributing a workbook by data. For example, assume there is a MonteCarlo simulation that accepts a number of iterations or a long list of values as an input. Framework may split these values into an equal parts, copy Excel documents with partial inputs to a cluster, execute documents on compute nodes on a grid, and return results to a main document, which initiated computation. Advantage is obvious - computation logic can be implemented in Excel workbook itself with formulas or VBA macros. Unfortunately, there are no generic-purpose frameworks that fully implement this approach. Existing solutions are implemented for some well-determined use cases, like parametric sweep or simple MonteCarlo computations.&lt;br /&gt;&lt;br /&gt;These two approaches are implemented by many computational and data grid vendors, which will be listed below. Most of the grids support only the first approach, because it simply doesn't require any special effort from grid vendors. They just create a couple of demos demonstrating distributed Excel with UDFs. Generally, this approach can be implemented on top of any grid, but only those with demos will be mentioned:&lt;br /&gt;&lt;br /&gt;&lt;a style="font-weight: bold;" href="http://www.microsoft.com/hpc/en/us/default.aspx"&gt;Microsoft HPC Server&lt;/a&gt;&lt;br /&gt;There are several solutions from Microsoft to run distributed Excel on HPC. These implement both approaches discussed above.&lt;br /&gt;&lt;br /&gt;The first approach with UDFs is represented by demos for sample models. There is no generic framework, because every user should implement her own UDF using preferred language. As it has been mentioned, custom UDFs have many advantages: effective parallelization, using API of HPC Server directly and rich programming environments (for example .NET instead Excel's VBA). Examples of this approach include &lt;a href="http://resourcekit.windowshpc.net/MORE_INFO/AsianOptions.html"&gt;AsianOptions sample Monte-Carlo model&lt;/a&gt;, ADAPTER demo (&lt;a href="http://channel9.msdn.com/shows/The+HPC+Show/Microsoft-Excel-Compute-cluster-server-ADAPTER-Demo/"&gt;blog post&lt;/a&gt;, &lt;a href="http://channel9.msdn.com/shows/The+HPC+Show/412585/player/"&gt;video&lt;/a&gt;, &lt;a href="http://social.microsoft.com/Forums/en-US/windowshpcdevs/thread/7c5ca44b-7626-438b-90fb-8cd6252d4f44"&gt;discussion&lt;/a&gt;), &lt;a href="http://www.microsoft.com/hpc/en/us/excel.aspx"&gt;HPC and Excel Services, but with UDFs&lt;/a&gt; (only marketing information without any technical description. Maybe this is a description of another approach/framework).&lt;br /&gt;&lt;br /&gt;The second approach, which allows computing Excel workbooks on the cluster, is represented by &lt;a href="http://msdn.microsoft.com/en-gb/library/bb463068.aspx"&gt;HPC Excel Services&lt;/a&gt;. To make this solution work, SharePoint Excel Services must be installed on every compute node on the cluster. Unfortunately, it seems it supports only parametric sweep-like models. This solution uses Excel add-in to specify job information, input data, and output data mappings. HPC Excel services support only lists as input values for parallelization and only lists for output values. Documentation is pretty extensive, &lt;a href="http://msdn.microsoft.com/en-gb/library/bb463020.aspx"&gt;sample models&lt;/a&gt; are described very well. Interesting feature of the solution is that it supports &lt;a href="http://msdn.microsoft.com/en-gb/library/bb507280.aspx"&gt;submitting models&lt;/a&gt; from SharePoint portal.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://en.wikipedia.org/wiki/Symphony_%28software%29"&gt;&lt;span style="font-weight: bold;"&gt;Platform Symphony&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;Platform supports both approaches as well - using UDFs, which implement actual parallelization logic, and computing actual Excel workbooks on compute nodes. There is no generic-purpose framework for this and everything should be customized for concrete Excel model. There is a very &lt;a href="http://platformdemos.com/excel/index.html"&gt;good demo&lt;/a&gt; describing this approach. Sample Excel workbook with description can be found &lt;a href="http://www.hpccommunity.org/f13/symphony-excel-sample-option-pricing-using-heston-model-45/"&gt;here&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;&lt;a style="font-weight: bold;" href="http://www.gigaspaces.com/xap"&gt;GigaSpaces XAP&lt;/a&gt;&lt;br /&gt;GigaSpaces &lt;a href="http://www.gigaspaces.com/excel"&gt;supports Excel models&lt;/a&gt; in a very interesting fashion. It supports running only UDFs, but since GigaSpaces is an in memory data grid more than HPC solution, the approach is oriented more on continuous computations rather than on batch jobs processing. Excel is considered like a UI for GigaSpaces grid. All interaction with the grid and all parallelization work is being done by UDFs. This approach resembles Excel &lt;a href="DataSynapse%20also%20%5Bsupports%20Excel%7Chttp://www.datasynapse.com/content1365%5D%20somehow,%20but%20there%20is%20no%20much%20information%20about%20it."&gt;Real-Time Server&lt;/a&gt; functionality. Demo called &lt;a href="http://www.gigaspaces.com/tempfiles/webcasts/ExcelSolution/ExcelSBA.html"&gt;Excel that scales&lt;/a&gt; demonstrates this approach. Obviously, orientation on sessions and continuous computations doesn't limit users from implementing UDFs with batch jobs.&lt;br /&gt;&lt;br /&gt;&lt;a style="font-weight: bold;" href="http://www.datasynapse.com/"&gt;DataSynapse&lt;/a&gt;&lt;br /&gt;DataSynapse also &lt;a href="http://www.datasynapse.com/content1365"&gt;supports Excel&lt;/a&gt; somehow, but there is no much information about it. Most likely, this is a demo of the first approach.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Conclusion&lt;/span&gt;&lt;br /&gt;There is a high demand in running heavy Excel calculations and there is no surprise that many grid vendors support distributed Excel to a some extent. There are several approaches to run Excel workbooks on a grid, from using Excel just as UI and accessing a grid via API from UDFs to calculating actual workbooks with VBA code on compute nodes. Unfortunately, there is still no generic-purpose production ready framework for seamless parallelizing workbooks with VBA, but there is a hope that it will appear sooner or later.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5477635599657734930-7301263214389571969?l=mcsimm.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mcsimm.blogspot.com/feeds/7301263214389571969/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5477635599657734930&amp;postID=7301263214389571969' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5477635599657734930/posts/default/7301263214389571969'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5477635599657734930/posts/default/7301263214389571969'/><link rel='alternate' type='text/html' href='http://mcsimm.blogspot.com/2009/08/distributed-excel-or-excel-on-grid.html' title='Distributed Excel or Excel on the Grid'/><author><name>Max Martynov</name><uri>http://www.blogger.com/profile/12000269073735478943</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5477635599657734930.post-1104674850844884724</id><published>2009-03-23T06:30:00.000-07:00</published><updated>2009-03-23T08:03:14.342-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='hpc'/><category scheme='http://www.blogger.com/atom/ns#' term='reflection'/><category scheme='http://www.blogger.com/atom/ns#' term='.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='reflexil'/><title type='text'>Reflexil.NET - Ultimate Win in the Fight with Third-Party Libraries</title><content type='html'>It is a pretty usual situation when third-party libraries do not work not as expected. And it is also usual that the most annoying artifacts are very small and easy to fix. However, without access to the source code, it is not possible to fix them. Reflection can help in some situations, but not always. The common solution is to ask library developers to fix it. However, it can take a lot of time, and sometimes these "defects" are not actually defects and exist by design to save users from shooting their own legs. These restrictions may be good, but it does not make them less disappointing. After all, in some cases users know better and in these cases such restrictions become defects.&lt;br /&gt;&lt;br /&gt;Recently, I have found such restriction in the SDK for Microsoft HPC Server. The SDK does not allow developer to specify custom credentials when connecting to the cluster. IScheduler.Connect method just uses Windows credentials of connecting process and throws "The server has rejected the client credentials." exception if anything goes wrong. This means that developer can not easily experiment with the cluster from remote development machine unless she is not in the same domain. The issue is described in &lt;a href="http://social.microsoft.com/Forums/en-US/windowshpcsched/thread/92140af1-a74f-4557-98a2-3e835d4913e6/"&gt;this topic&lt;/a&gt;. Unfortunately, in my situation, the answer did not work. The opportunity to deploy applications on the cluster after each change and debug them remotely was not very promising. So I hoped to solve this issue somehow.&lt;br /&gt;&lt;br /&gt;The first thing I have decided to investigate is how SDK connects to the cluster. With the help of  &lt;a href="http://www.red-gate.com/products/reflector/"&gt;.NET Reflector&lt;/a&gt; that was easy. I found out that SDK uses remoting with tcp channel. The only thing that separated me from connecting with custom credentials was adding them to channel sink properties:&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_sZh4q0-S4-Y/Scef3xvHmEI/AAAAAAAABbg/HbPShkOvBzA/s1600-h/Original.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://4.bp.blogspot.com/_sZh4q0-S4-Y/Scef3xvHmEI/AAAAAAAABbg/HbPShkOvBzA/s800/Original.png" alt="" id="BLOGGER_PHOTO_ID_5316393665726748738" border="0" /&gt;&lt;/a&gt;&lt;span style="font-size:78%;"&gt;Pic.1. Original assembly - connecting with process credentials.&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;It was really disappointing. So close from painless remote access.&lt;br /&gt;&lt;br /&gt;Everybody knows about Reflector, but relatively small number of people know about a brilliant plug-in to Reflector called &lt;a href="http://sebastien.lebreton.free.fr/reflexil/"&gt;Reflexil&lt;/a&gt;. This great tool allows developers to modify assemblies in a very easy and straightforward way. So, a bit of luck and here it is:&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_sZh4q0-S4-Y/Scef8ycDsmI/AAAAAAAABbo/IU6HN84TbUo/s1600-h/Improved.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://4.bp.blogspot.com/_sZh4q0-S4-Y/Scef8ycDsmI/AAAAAAAABbo/IU6HN84TbUo/s800/Improved.png" alt="" id="BLOGGER_PHOTO_ID_5316393751814582882" border="0" /&gt;&lt;/a&gt;&lt;span style="font-size:78%;"&gt;Pic.2. Modified assembly - connecting with custom credentials.&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;span style="font-size:78%;"&gt; &lt;/span&gt;&lt;br /&gt;A couple of lines of code and remote access with custom credentials worked perfectly. Of course, this version of the library should not be used in production, but at least a lot of pain in development stage went away.&lt;br /&gt;&lt;br /&gt;P.S.: Good Reflexil tutorial with pictures can be found on &lt;a href="http://www.codeproject.com/KB/msil/reflexil.aspx"&gt;CodeProject&lt;/a&gt;.&lt;br /&gt;P.P.S.: It took me another 20 minutes to get rid of hardcoded password and to change IScheduler.Connect method to accept credentials. Reflexil is indeed very easy to use.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5477635599657734930-1104674850844884724?l=mcsimm.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mcsimm.blogspot.com/feeds/1104674850844884724/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5477635599657734930&amp;postID=1104674850844884724' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5477635599657734930/posts/default/1104674850844884724'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5477635599657734930/posts/default/1104674850844884724'/><link rel='alternate' type='text/html' href='http://mcsimm.blogspot.com/2009/03/reflexilnet-ultimate-win-in-fight-with.html' title='Reflexil.NET - Ultimate Win in the Fight with Third-Party Libraries'/><author><name>Max Martynov</name><uri>http://www.blogger.com/profile/12000269073735478943</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_sZh4q0-S4-Y/Scef3xvHmEI/AAAAAAAABbg/HbPShkOvBzA/s72-c/Original.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5477635599657734930.post-3578782893955317855</id><published>2009-02-13T08:17:00.000-08:00</published><updated>2009-02-16T08:42:42.154-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><category scheme='http://www.blogger.com/atom/ns#' term='dosgi'/><category scheme='http://www.blogger.com/atom/ns#' term='distributed systems'/><category scheme='http://www.blogger.com/atom/ns#' term='osgi'/><title type='text'>Distributed OSGi: Levels of Transparency</title><content type='html'>At the moment, RFC 119 contains 4 levels of transparency of Distributed OSGi for a developer. They range from completely transparent behavior, where no code should be changed to use remote OSGi container, to possibility of handling distribution software specific exceptions. All of them, if I understood them correctly, can be described in the following way:&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_sZh4q0-S4-Y/SZWe74cu5VI/AAAAAAAABbE/st3oTbaYjRI/s1600-h/transparent_1.PNG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://1.bp.blogspot.com/_sZh4q0-S4-Y/SZWe74cu5VI/AAAAAAAABbE/st3oTbaYjRI/s800/transparent_1.PNG" alt="" id="BLOGGER_PHOTO_ID_5302318887900996946" border="0" /&gt;&lt;/a&gt;&lt;span style="font-size:78%;"&gt;Picture 1. Transparency levels 1-4&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;There is no doubt that in &lt;span style="font-style: italic;"&gt;most&lt;/span&gt; cases these levels will satisfy all developer needs. However, since the distributed communication technology is hidden from the developer, such model may have a number of limitations. For example, it will  be hard to make asynchronous method calls or to use communication technology-specific features.&lt;br /&gt;&lt;br /&gt;So, it may be worth considering to support less transparent models. For example, when the client can obtain an remote endpoint or a reference to the proxy, created by distribution software:&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_sZh4q0-S4-Y/SZWfCo5y1lI/AAAAAAAABbM/stdYL7Kx-BE/s1600-h/transparent_2.PNG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://4.bp.blogspot.com/_sZh4q0-S4-Y/SZWfCo5y1lI/AAAAAAAABbM/stdYL7Kx-BE/s800/transparent_2.PNG" alt="" id="BLOGGER_PHOTO_ID_5302319003987007058" border="0" /&gt;&lt;/a&gt;&lt;span style="font-size:78%;"&gt;Picture 2. Transparency level 5&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;This model can also be extended to the level, where the OSGi proxy on the client side is created by OSGi service developer, not framework. Current version of Riena may &lt;a href="http://wiki.eclipse.org/Riena_Getting_started_remoteservices#Accessing_the_remote_OSGi_Service"&gt;serve as an example&lt;/a&gt; of this case. &lt;span style="font-style: italic;"&gt;Upd.: Newton, and, hence, Infiniflow also &lt;a href="http://newton.codecauldron.org/site/example/SmartProxyDemo.html"&gt;support&lt;/a&gt; writing a kind of custom proxies.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Moreover, fully &lt;span style="font-style: italic;"&gt;non-transparent&lt;/span&gt; model can also be useful:&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_sZh4q0-S4-Y/SZWfF-PKhWI/AAAAAAAABbU/NjSmrevZgBY/s1600-h/transparent_3.PNG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://1.bp.blogspot.com/_sZh4q0-S4-Y/SZWfF-PKhWI/AAAAAAAABbU/NjSmrevZgBY/s800/transparent_3.PNG" alt="" id="BLOGGER_PHOTO_ID_5302319061253391714" border="0" /&gt;&lt;/a&gt;&lt;span style="font-size:78%;"&gt;Picture 3. Transparency level 7&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;In this model, the service is exposed not through OSGi, but through the chosen distributed communication technology, like RMI. This service can also be registered in the OSGi service registry, but can't be used as an OSGi service. Every client, which wants to use it, can track this service, and when it comes online, can extract required data establish direct connection to the service using communication framework-specific proxy.&lt;br /&gt;&lt;br /&gt;This model can suite either legacy applications, where components already exist and communicate with each other using some distributed communication framework. Also, the model can be useful when developer wants to use some communication framework-specific features and doesn't want to refuse OSGi convinience in the field of module management and service tracking.&lt;br /&gt;&lt;br /&gt;P.S. It worth noting that similar ideas have already appeared in the &lt;a href="http://wiki.eclipse.org/Comments_on_the_Riena_Project_Goals_and_Relationship_to_ECF_project"&gt;comments on Riena project goals&lt;/a&gt;. However, I am not sure about exact levels of transparency mentioned there.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5477635599657734930-3578782893955317855?l=mcsimm.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mcsimm.blogspot.com/feeds/3578782893955317855/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5477635599657734930&amp;postID=3578782893955317855' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5477635599657734930/posts/default/3578782893955317855'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5477635599657734930/posts/default/3578782893955317855'/><link rel='alternate' type='text/html' href='http://mcsimm.blogspot.com/2009/02/distributed-osgi-levels-of-transparency.html' title='Distributed OSGi: Levels of Transparency'/><author><name>Max Martynov</name><uri>http://www.blogger.com/profile/12000269073735478943</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_sZh4q0-S4-Y/SZWe74cu5VI/AAAAAAAABbE/st3oTbaYjRI/s72-c/transparent_1.PNG' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5477635599657734930.post-3752505926023275724</id><published>2009-02-06T08:22:00.000-08:00</published><updated>2009-02-06T10:25:03.644-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='newton'/><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><category scheme='http://www.blogger.com/atom/ns#' term='distributed systems'/><category scheme='http://www.blogger.com/atom/ns#' term='r-osgi'/><category scheme='http://www.blogger.com/atom/ns#' term='osgi'/><title type='text'>Traps on the Way from OSGi to Distributed OSGi</title><content type='html'>&lt;a href="http://en.wikipedia.org/wiki/OSGi"&gt;OSGi&lt;/a&gt; is a powerful technology for an &lt;span class="mw-redirect"&gt;application life cycle management. It deals with configuration and change management and helps to build quality service oriented systems. OSGi is pretty popular framework with broad applicability and many mature implementations. Eclipse IDE is maybe the most commonly used example of application build with OSGi. &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;This sounds very good, but &lt;a href="http://www.osgi.org/Release4/HomePage"&gt;current OSGi standard&lt;/a&gt; deals only applications running in the single JVM. It is obvious that the latest trends with scaling everything out diminish the value of this great technology to a large degree. So, there is no surprise that third party frameworks, built on top of OSGi, appeared on the horizon. &lt;a href="http://newton.codecauldron.org/site/index.html"&gt;Newton&lt;/a&gt; and &lt;a href="http://r-osgi.sourceforge.net/index.html"&gt;R-OSGi&lt;/a&gt; are maybe the most well-known ones. From the OSGi side, &lt;a href="http://www.osgi.org/Specifications/Drafts"&gt;latest drafts&lt;/a&gt; of the standard include specification of Distributed OSGi also known as RFC 119. As far as I know, there is no production-ready implementation of this RFC, but there were &lt;a href="http://www.eweek.com/c/a/Application-Development/Distributed-OSGi-Effort-Progresses/"&gt;successful demos&lt;/a&gt;, and the RFC itself is very mature at the moment. All of these approaches to distribute OSGi are really interesting and worth discussing, but for now I am not going to dive deep into them.&lt;br /&gt;&lt;br /&gt;The thing I am aware of at the moment is that OSGi is essentially just a framework for module (or component) management. When it deals with components in one JVM, everything is good. But moving to distribute environment will bring many new problems, like the need of communication medium between components. The desire (or need) to implement yet another RMI as a part of OSGi can be very strong. However, in my opinion, this should be avoided soever. OSGi is not a communication technology - there are lot of them on the market, covering different areas and created for different purposes. Implementing a new one, which will cover all required ways of communication, is hard. Distributed OSGi, on the opposite, should not cover this topic at all, dealing only with what OSGi deals the best - managing modules lifecycle, but in a distribute fashion. In the ideal situation , developers should have free choice of communication medium between modules, according to the requirements of the project.&lt;br /&gt;&lt;br /&gt;This problem touches &lt;a href="http://java.dzone.com/articles/distributed-osgi-%E2%80%94-tilting-win"&gt;not only me&lt;/a&gt;, but the good news are that it seems creators of RFC 119 are on the &lt;a href="http://www.tensegrity.hellblazer.com/2008/06/distributed-osgi---on-the-scent-of-red-herrings.html"&gt;right way&lt;/a&gt;. Other technologies for distributing OSGi are not so good from this point of view: R-OSGi introduces custom communication medium, and Newton makes use of Jini and RMI. It is not exactly bad for them, because they maybe can solve other problems better and they are ready to use right now, unlike RFC 119.&lt;br /&gt;&lt;br /&gt;Actually, to correctly and objectively compare these technologies, additional research is required and it is not the goal of this post. If somebody is interested in the topic, &lt;a href="http://www.tensegrity.hellblazer.com/"&gt;Hal Hildebrand's blog&lt;/a&gt; can be used as a great source of an interesting information about RFC 119, OSGi in general, and in particularly, &lt;a href="http://www.tensegrity.hellblazer.com/2007/03/distributing-osgi---differences-from-r-osgi.html"&gt;comparison&lt;/a&gt; of R-OSGi and Distributed OSGi.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5477635599657734930-3752505926023275724?l=mcsimm.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mcsimm.blogspot.com/feeds/3752505926023275724/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5477635599657734930&amp;postID=3752505926023275724' title='6 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5477635599657734930/posts/default/3752505926023275724'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5477635599657734930/posts/default/3752505926023275724'/><link rel='alternate' type='text/html' href='http://mcsimm.blogspot.com/2009/02/traps-on-way-from-osgi-to-distributed.html' title='Traps on the Way from OSGi to Distributed OSGi'/><author><name>Max Martynov</name><uri>http://www.blogger.com/profile/12000269073735478943</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>6</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5477635599657734930.post-3211031906179797655</id><published>2009-02-03T05:33:00.000-08:00</published><updated>2009-02-03T06:17:48.043-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><category scheme='http://www.blogger.com/atom/ns#' term='JAR'/><title type='text'>Problems with Manifest in JAR</title><content type='html'>It is widely known that &lt;a href="http://en.wikipedia.org/wiki/JAR_%28file_format%29"&gt;JAR&lt;/a&gt; files are built on the ZIP file format. So any jar file can be opened with zip archiver, and, to create jar file, &lt;span style="font-family: courier new;"&gt;zip&lt;/span&gt; tools can be used. The only major difference is that jar files may have optional META-INF directory with MANIFEST.MF and other files related with meta-information.&lt;br /&gt;&lt;br /&gt;Everything looks very simple. However, today I have faced one problem with finding manifest file in the jar. I have created zip file from the directory with the simple structure:&lt;br /&gt;-META-INF&lt;br /&gt;--MANIFEST.MF&lt;br /&gt;-A.class&lt;br /&gt;-B.class&lt;br /&gt;&lt;br /&gt;After extension was changed to jar, this file was used by an external application, which tried to locate manifest in the file. This was a great surprise when the application was not able to find it. I tried to use &lt;span style="font-family: courier new;"&gt;jar&lt;/span&gt; util to prepare the package. When I pushed the result file to the application, it successfully found the manifest.&lt;br /&gt;&lt;br /&gt;The situation was pretty strange - contents of both archives was identical and I knew that JAR files should not store any additional metainformation about manifests, but the experience showed the opposite.  There were some doubts about possibly buggy logic in the client application, which read my jars. I looked through its source codes and found that it just uses standand &lt;span style="font-family: courier new;"&gt;JarInputStream&lt;/span&gt; from &lt;span style="font-family: courier new;"&gt;java.util.jar&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;However, when I investigated this class, I noticed one thing that could be the cause of such behavior: logic responsible for finding manifest in the JAR&lt;span style="font-family: courier new;"&gt;&lt;/span&gt; assumes that META-INF directory should be located in the beginning of the archive. I investigated both my archives and it turned out that the one, created with &lt;span style="font-family: courier new;"&gt;zip&lt;/span&gt; tool placed this directory in the end. But the archive created with &lt;span style="font-family: courier new;"&gt;jar&lt;/span&gt; stored META-INF in the beginning, as it is expected.&lt;br /&gt;&lt;br /&gt;So, if somebody still wants to create jar files with &lt;span style="font-family: courier new;"&gt;zip&lt;/span&gt; tools, do not forget to place META-INF in the beginning of the archive. Do not also forget to add two empty lines in the end of the manifest file, just in case.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5477635599657734930-3211031906179797655?l=mcsimm.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mcsimm.blogspot.com/feeds/3211031906179797655/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5477635599657734930&amp;postID=3211031906179797655' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5477635599657734930/posts/default/3211031906179797655'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5477635599657734930/posts/default/3211031906179797655'/><link rel='alternate' type='text/html' href='http://mcsimm.blogspot.com/2009/02/problems-with-manifest-in-jar.html' title='Problems with Manifest in JAR'/><author><name>Max Martynov</name><uri>http://www.blogger.com/profile/12000269073735478943</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5477635599657734930.post-4981116362467584254</id><published>2009-01-29T04:17:00.000-08:00</published><updated>2009-01-29T04:27:32.777-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='speculation'/><category scheme='http://www.blogger.com/atom/ns#' term='definition'/><category scheme='http://www.blogger.com/atom/ns#' term='architecture'/><category scheme='http://www.blogger.com/atom/ns#' term='dzen'/><title type='text'>On Architecture in IT</title><content type='html'>Definition of architect and architecture:&lt;br /&gt;Architect is a person, who has a vision of how the system should be built.&lt;br /&gt;Architecture is a specification describing how the system should be built.&lt;br /&gt;&lt;br /&gt;Architecture checklist (the things an architect should, at least partially, care about):&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Domain&lt;br /&gt;&lt;/li&gt;&lt;li&gt;External interfaces, including UI&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Integration with other systems&lt;/li&gt;&lt;li&gt;Security&lt;/li&gt;&lt;li&gt;Performance&lt;/li&gt;&lt;li&gt;Scalability&lt;/li&gt;&lt;li&gt;Configuration and change management&lt;/li&gt;&lt;li&gt;Monitoring&lt;/li&gt;&lt;li&gt;Technology zoo&lt;/li&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5477635599657734930-4981116362467584254?l=mcsimm.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mcsimm.blogspot.com/feeds/4981116362467584254/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5477635599657734930&amp;postID=4981116362467584254' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5477635599657734930/posts/default/4981116362467584254'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5477635599657734930/posts/default/4981116362467584254'/><link rel='alternate' type='text/html' href='http://mcsimm.blogspot.com/2009/01/on-architecture-in-it.html' title='On Architecture in IT'/><author><name>Max Martynov</name><uri>http://www.blogger.com/profile/12000269073735478943</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5477635599657734930.post-4613995488231772105</id><published>2009-01-28T08:21:00.000-08:00</published><updated>2009-01-30T06:51:38.123-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='performance'/><category scheme='http://www.blogger.com/atom/ns#' term='IceGrid'/><category scheme='http://www.blogger.com/atom/ns#' term='GigaSpaces'/><category scheme='http://www.blogger.com/atom/ns#' term='IMDG'/><category scheme='http://www.blogger.com/atom/ns#' term='ICE'/><category scheme='http://www.blogger.com/atom/ns#' term='scalability'/><category scheme='http://www.blogger.com/atom/ns#' term='data grid'/><category scheme='http://www.blogger.com/atom/ns#' term='GridGain'/><category scheme='http://www.blogger.com/atom/ns#' term='compute grid'/><title type='text'>ICE - Object Grid</title><content type='html'>&lt;a href="http://en.wikipedia.org/wiki/Grid_computing"&gt;Grid computing&lt;/a&gt; was born to solve extreme problems using combined power of many servers. Later it came to enterprise in two major forms: computational grids and &lt;a href="http://en.wikipedia.org/wiki/In_Memory_Data_Grid"&gt;in memory data grids&lt;/a&gt;. First ones were aimed to solve heavy computational problems, anothers' goal was to provide fast and convenient access to large amounts of data by storing it in memory.&lt;br /&gt;&lt;br /&gt;But it turned out, that people often needed to solve complex computation problems, which required fast access to a large amount of data. So, they needed to combine these technologies. This was pretty clear for grid providers, so many popular compute grids, like &lt;a href="http://www.gridgain.com/"&gt;GridGain&lt;/a&gt; and &lt;a href="http://www.datasynapse.com/"&gt;DataSynapse&lt;/a&gt;, provided functionality to store data in memory in a distributed way. On the other side, many popular data grids, like &lt;a href="http://www.oracle.com/technology/products/coherence/index.html"&gt;Oracle Coherence&lt;/a&gt; and &lt;a href="http://www.gigaspaces.com/"&gt;GigaSpaces&lt;/a&gt;, provided features to run parallel computations. However, they still played their own role better: compute grid had better functionality to run distributed computations than data grid, and vice versa. In some cases this problem was solved by maintaining two grid installations: compute grid, running parallel computations, used data grid, where the data for these computations were stored.&lt;br /&gt;&lt;br /&gt;Anyway, one problem remained: computations may run on server, different  from the server, where the data for this computation is stored. Each vendor tries to solve this problem by providing its own &lt;a href="http://blog.griddynamics.com/2008/02/bridging-paradigms-convergence-of.html"&gt;data-aware routing&lt;/a&gt; techniques. In case of using multiple grid tools, this required &lt;a href="http://blog.griddynamics.com/2008/02/data-aware-routing-datasynapse_14.html"&gt;additional efforts&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Recently, one interesting framework, called &lt;a href="http://www.zeroc.com/"&gt;ICE&lt;/a&gt;, have appeared on the horizon&lt;a href="http://www.zeroc.com/"&gt;&lt;/a&gt;. It is a pretty general framework and in a couple of words, it looks like CORBA on steroids. Based on this tool, there is a grid solution, called &lt;a href="http://www.zeroc.com/icegrid/index.html"&gt;IceGrid&lt;/a&gt;. This grid stores data and computations in the same place in the form of objects (remember, this is just like CORBA). From the documentation it looks like that load balancing, replication, and other important grid-related stuff is in place. This product also has a number of significant installations in a real heavy loaded and highly scalable environments. So, at least, it worth learning.&lt;br /&gt;&lt;br /&gt;I do not think that object oriented approach is a killer feature for the world of large-scale systems. For many heavy tasks it is better and clearer to have logic and data separated. But maybe for some tasks, IceGrid's approach will be better.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5477635599657734930-4613995488231772105?l=mcsimm.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mcsimm.blogspot.com/feeds/4613995488231772105/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5477635599657734930&amp;postID=4613995488231772105' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5477635599657734930/posts/default/4613995488231772105'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5477635599657734930/posts/default/4613995488231772105'/><link rel='alternate' type='text/html' href='http://mcsimm.blogspot.com/2009/01/ice-object-grid.html' title='ICE - Object Grid'/><author><name>Max Martynov</name><uri>http://www.blogger.com/profile/12000269073735478943</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5477635599657734930.post-3217844130356785641</id><published>2009-01-27T05:36:00.000-08:00</published><updated>2009-01-27T07:22:42.538-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><category scheme='http://www.blogger.com/atom/ns#' term='.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='WMI'/><category scheme='http://www.blogger.com/atom/ns#' term='performance counters'/><category scheme='http://www.blogger.com/atom/ns#' term='management'/><category scheme='http://www.blogger.com/atom/ns#' term='monitoring'/><category scheme='http://www.blogger.com/atom/ns#' term='JMX'/><title type='text'>JMX for .NET</title><content type='html'>&lt;a href="http://en.wikipedia.org/wiki/JMX"&gt;JMX&lt;/a&gt; is a Java technology, which enables management and monitoring of Java applications. JMX is widely supported among software vendors. Many Java frameworks, including almost all application servers, provide access to the monitoring and management information via JMX,  both as providers and cosumers. JMX consumer tools include &lt;a href="http://java.sun.com/developer/technicalArticles/J2SE/jconsole.html"&gt;JConsole&lt;/a&gt;, &lt;a href="http://www.hyperic.com/"&gt;Hyperic HQ&lt;/a&gt;, &lt;a href="http://www.zenoss.com/"&gt;Zenoss&lt;/a&gt;. But the main advantage of this technology is &lt;a href="http://java.sun.com/developer/technicalArticles/J2SE/jmx.html"&gt;simplicity of using&lt;/a&gt; it to manage and monitor custom application.&lt;br /&gt;&lt;br /&gt;Having this great technology in Java, it is not unusual to hear the question about which technology in .NET provides the same functionality. Generally, there is no exact clone .NET of JMX, however, there are some technologies, which can be used as an equivalent of JMX in .NET world. This technologies include &lt;a href="http://en.wikipedia.org/wiki/Windows_Management_Instrumentation"&gt;Windows Management Instrumentation&lt;/a&gt; (WMI), &lt;a href="http://www.codeproject.com/KB/dotnet/perfcounter.aspx"&gt;Performance Counters&lt;/a&gt;, and &lt;a href="http://mcsimm.blogspot.com/2009/01/getting-started-with-net-profiling-api.html"&gt;.NET Profiling API&lt;/a&gt;. To be honest, first two technologies are related with Windows, but they can be used from .NET too, as it usually happens. Let's have a look at these tools:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;.NET Profiling API&lt;/span&gt;&lt;br /&gt;Unlike JMX, which covers both monitoring and management, &lt;a href="http://mcsimm.blogspot.com/2009/01/getting-started-with-net-profiling-api.html"&gt;.NET Profiling API&lt;/a&gt; deals only with monitoring. The API is pretty complex, but this complexity is repaid, because it allows developers to track every moment of application's life. Obviously, it is not a full equivalent of JMX in .NET, but it will cover use cases, where fine-grained and extensive monitoring is required.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Performance Counters&lt;/span&gt;&lt;br /&gt;&lt;a href="http://www.codeproject.com/KB/dotnet/perfcounter.aspx"&gt;Performance Counters&lt;/a&gt; also deal only with monitoring application performance. Each counter is registered globally in Windows and can be used by applications, which fill the counter with performance information, and by applications, which track this information. Consumers of peformance counters include &lt;a href="http://en.wikipedia.org/wiki/System_Monitor"&gt;Performance Monitor&lt;/a&gt; (similar to JConsole to a some extent), &lt;a href="http://support.hyperic.com/display/hypcomm/Windows+Plugin"&gt;Hyperic HQ with required plugins&lt;/a&gt;, etc. If developer's main goal is monitoring, Performance Counters can be freely used as an equivalent in .NET applications.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Windows Management Instrumentation&lt;/span&gt;&lt;br /&gt;&lt;a href="http://en.wikipedia.org/wiki/Windows_Management_Instrumentation"&gt;WMI&lt;/a&gt; is a Microsoft technology used for monitoring and management of devices and applications running on Windows. From the previous options, WMI resembles JMX the most. It looks a bit complex than JMX from the &lt;a href="http://msdn.microsoft.com/en-us/library/aa394553%28VS.85%29.aspx"&gt;archtecture&lt;/a&gt; and &lt;a href="http://www.codeproject.com/KB/system/wmiproviderguide.aspx?display=Print"&gt;.NET end-user&lt;/a&gt; points of view, but it also should provide more features. WMI was initially based on COM, so first implementation for .NET was pretty complex in terms of WMI providers' development, and the entire functionality was &lt;a href="http://msdn.microsoft.com/en-us/library/ms186136%28VS.80%29.aspx"&gt;limited&lt;/a&gt; to monitoring. However, in &lt;a href="http://msdn.microsoft.com/en-us/library/cc268228%28printer%29.aspx"&gt;WMI extensions for .NET 3.5&lt;/a&gt; limitations were removed and &lt;a href="http://www.codeproject.com/KB/system/WMIProviderExtensions.aspx"&gt;writing WMI provider&lt;/a&gt; became easier. Like JMX, WMI is used by many monitoring tools, so, it can be treated as almost equal to JMX in Windows and .NET environment.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Custom Implementation&lt;/span&gt;&lt;br /&gt;The fourth option can suite developers, who uses JMX in their applications, but doesn't use other JMX-enabled tools. It can happen when both JMX provider and consumer applications are home-grown and the power of the fact, that JMX is standard, is not used. In this case, custom objects exposed through &lt;a href="http://en.wikipedia.org/wiki/Windows_Communication_Foundation"&gt;WCF&lt;/a&gt;, &lt;a href="http://en.wikipedia.org/wiki/Remoting"&gt;Remoting&lt;/a&gt;, &lt;a href="http://msdn.microsoft.com/en-us/library/ms972326.aspx"&gt;ASP.NET web services&lt;/a&gt;, or other communication means can be used.&lt;br /&gt;&lt;br /&gt;So, if developer migrates from Java to .NET and searching for equivalent of JMX, he have a number of options. The exact choice will, as always, depend on the concrete use case.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5477635599657734930-3217844130356785641?l=mcsimm.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mcsimm.blogspot.com/feeds/3217844130356785641/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5477635599657734930&amp;postID=3217844130356785641' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5477635599657734930/posts/default/3217844130356785641'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5477635599657734930/posts/default/3217844130356785641'/><link rel='alternate' type='text/html' href='http://mcsimm.blogspot.com/2009/01/jmx-for-net.html' title='JMX for .NET'/><author><name>Max Martynov</name><uri>http://www.blogger.com/profile/12000269073735478943</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5477635599657734930.post-1063328896252878163</id><published>2009-01-23T04:54:00.000-08:00</published><updated>2009-01-25T12:43:18.415-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='monitoring'/><category scheme='http://www.blogger.com/atom/ns#' term='profiling'/><category scheme='http://www.blogger.com/atom/ns#' term='CLR'/><title type='text'>Getting Started with .NET Profiling API</title><content type='html'>In a couple of words, .NET Profiling API allows writing a program, which can monitor other CLR program's execution. Tools like &lt;a href="http://www.jetbrains.com/profiler/"&gt;JetBrains dotTrace&lt;/a&gt; and the similar can be written using this API.&lt;br /&gt;&lt;br /&gt;There is a lot of detailed information about .NET Profiling API in the Internet, so I will just try to list existing sources.&lt;br /&gt;&lt;ol&gt;&lt;li&gt;&lt;a href="http://www.blong.com/Conferences/DCon2003/Internals/Profiling.htm"&gt;.NET Internals: The Profiling API&lt;/a&gt;.  Introduction to monitoring of .NET applications using performance counters and .NET 1.0 Profiling API. Contains theory and source code samples. Unfortunately, samples are written in Delphi and there is no project, which is ready-to-compile-and-work.&lt;/li&gt;&lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/magazine/cc301725.aspx"&gt;Under the Hood: .NET Profiling API and the DNProfiler Tool&lt;/a&gt;. Little amount of theory with a couple of practical hints of profiler implementation with 1.0 version of API. Unfortunately, link to DNProfiler is broken.&lt;/li&gt;&lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/magazine/cc188781.aspx"&gt;Inspect and Optimize Memory Usage with the .NET Profiler API&lt;/a&gt;. Acticle regarding memory monitoring with sample application and source codes, written with 1.0 version of API. Sample builds well, but doesn't work in my environment, maybe because I tried to build samples with .NET 2.0 and profiler was implemeted version 1.0 of profiling API.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.codeproject.com/KB/dotnet/dotnetprofiler.aspx"&gt;Creating a Custom .NET Profiler&lt;/a&gt;. A couple of hints with working profiler sample in compiled and source code forms. Profiler is written using .NET 2.0 version of API.&lt;/li&gt;&lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/magazine/cc300553.aspx"&gt;No Code Can Hide from the Profiling API in the .NET Framework 2.0&lt;/a&gt;. Description of new features in 2.0 version of API and working piece of sample code.&lt;/li&gt;&lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/bb264782.aspx"&gt;Profiler Stack Walking in the .NET Framework 2.0: Basics and Beyond&lt;/a&gt;. Piece of theory about Profiling API without working sample. Version 2.0 is covered.&lt;/li&gt;&lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/magazine/cc188743.aspx"&gt;Rewrite MSIL Code on the Fly with the .NET Framework Profiling API&lt;/a&gt;, &lt;a href="http://blog.monstuff.com/archives/000058.html"&gt;Modifying IL at Runtime&lt;/a&gt;, &lt;a href="http://blog.monstuff.com/archives/000059.html"&gt;Modifying IL at Runtime (step II)&lt;/a&gt;, &lt;a href="http://blog.monstuff.com/archives/000060.html"&gt;Modifying IL at Runtime (step II+)&lt;/a&gt;, &lt;a href="http://blog.monstuff.com/archives/000077.html"&gt;Modifying IL at Runtime (step III)&lt;/a&gt;. A set of articles on using .NET Profiling API for generating code at runtime. Covers version 1.0 of API.&lt;br /&gt;&lt;/li&gt;&lt;/ol&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5477635599657734930-1063328896252878163?l=mcsimm.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mcsimm.blogspot.com/feeds/1063328896252878163/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5477635599657734930&amp;postID=1063328896252878163' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5477635599657734930/posts/default/1063328896252878163'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5477635599657734930/posts/default/1063328896252878163'/><link rel='alternate' type='text/html' href='http://mcsimm.blogspot.com/2009/01/getting-started-with-net-profiling-api.html' title='Getting Started with .NET Profiling API'/><author><name>Max Martynov</name><uri>http://www.blogger.com/profile/12000269073735478943</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>
