November 6, 2015

Whitepaper – Capacity Planning for Application Design – Part 1

Filed under: Uncategorized — mifan @ 8:43 am

Capacity planning and the ability to determine and forecast the capacity of a solution is a key aspect in enterprise solution architecture and design. Capacity planning is an art as much as it is a science, and experience plays a big part in the design of a solution. This white paper attempts to explore the science of this discipline – it will look at the theory of capacity planning, and discuss the important concepts and parameters, and some practical examples.

In a follow up paper, we’ll apply these concepts to determine the capacity of an actual use case using the WSO2 middleware platform with step-by-step examples.

August 17, 2015

Whitepaper: Big Data Analytics In Sports – Introducing Football’s new 12th Man

Filed under: Uncategorized — mifan @ 4:09 pm

My recent white paper focuses on big data analytics in football/soccer: Big data analytics in sports – Introducing Football’s new 12th man


Goal! Lionel Messi lets loose a curling free kick from 20 metres out – over the Ajax wall and into the top left corner of the netting. Jasper Cillessen has no chance. Alongside great skill, relentless practice, individual presence of mind and the team effort that led to the free kick, science also played a big role in that goal – knowing exactly how the defender would react, how much spin is needed on the ball, the goal keeper’s strong side and who’d be taking the left sided free kick was already part of the pre-match briefing. A great team [arguably the best club today (disclaimer: the author of this white paper is an Arsenal fan so that means a lot!)] turned to a super team with the science of data analytics.

This white paper will look at why data analytics is important in football, and for that matter in any sport, along with the case for data analytics. It will also discuss the details of a solution and explain the features such a solution or technology can provide. Moreover, the paper will also take you through how this can be achieved with a technology stack that supports big data analytics.

I’m especially proud of the last image in the white paper, which is something I took during Arsenal’s FA cup victory parade in London


February 16, 2015

Workshop: Architecting and enterprise API Management strategy

Filed under: Uncategorized — mifan @ 10:57 am

A good internal and external API management strategy and architecture is key to building ecosystem platforms that lead to successful API economies in the enterprise.

Slides: Architecting an Enterprise API Management Strategy

This workshop that I presented at APIDays in Sydney looks at best practices in API management using the WSO2 API Manager and Integration Platform products, which are used to rapidly implement RESTful design, enforce governance policies, safely scale solutions, orchestrate complex interaction sequences, and re-use assets. The session also looked at reference architectures and architectural recommendations of building large scale API ecosystems.

November 4, 2014

Concurrency, Transactions per Second and Capacity Planning for Application Design

Filed under: Uncategorized — mifan @ 1:20 pm

The ability to determine or forecast the capacity of a system or set of components, commonly known as ’sizing’ a system, is an important activity in enterprise system design and Solution Architecture. Oversizing a system leads to excess costs in terms of hardware resources, whilst undersizing might lead to  reduced performance and the inability for a system to serve its intended purpose.

The complexity of course is forecasting the capacity to a fair degree of accuracy. Capacity Planning in enterprise systems design is an art as much as it is a science. Along with certain parameters, it also involves experience, knowledge of the domain itself and inside knowledge of the system. In some instances, it goes as far as analysing the psychology of the system’s expected users, their usage pattern etc.

This post deals with some parameters of capacity planning, with a focus on how a few factors such as concurrency and Transactions per Second (TPS) play a role in it. Of course, many other factors could determine the capacity of a system, including the complexity of transactions, latency and external service calls, memory allocation and utilisation etc.

Throughput and TPS
Throughput is a measure of the number of actions per unit time, where time can be in seconds, minutes, hours etc. Transactions per Second (TPS) is the number of atomic actions, in this case ‘transactions’, per second. For a stateless server, this will be the major characteristic that affects the server capacity.

Theoretically speaking, if a user performs 60 transactions in a minute, then the TPS would be 60/60 TPS = 1 TPS. . Of course, not all concurrent users who are logged into a system might necessarily be using that system. Additionally, think time and pace time comes into consideration.

Concurrent users are the number of users concurrently accessing the system at any given time. In capacity planning, this has several meanings and implications. In an application server with a stateful application which handles sessions, the number of concurrent users will play a bigger role than in an ESB which handles stateless access, for instance. However concurrent users doesn’t necessarily mean a load on the system of the same amount. If 200 concurrent users are logged into the system, and have a 10 second think time, then that amounts to roughly 20 actual concurrent users hitting the system. For systems designed in such a way, each concurrent user consumes some level of memory which needs to be taken into account.

Application design and optimisation
The design of the application or software plays a big role in capacity planning. For each concurrent user if a session is created, then this means some level of memory consumption per session. For each operation, factors such as open database connections, the number of application ‘objects’ stored in memory, the amount of processing that takes place etc determines the amount of memory and processing capacity required. Well designed applications will strive to keep these numbers low or would ‘share’ resources effectively. The number of resources that configured for an application also play a role. For instance for database intensive operations, the database connection pool size would be a limiting factor. Similarly thread pool values, garbage collation times etc also determine the performance of a system. Profiling and load testing an application with tools would help determine the bottlenecks of an application.

Message Size
The size of the message passed across the ‘wire’ is also an important factor in determining the required capacity of a system. Larger messages mean more processing power requirement, more memory requirements, or both.

Work done per transaction
Each incoming ‘transaction’ to a server will have some level of operations that it triggers on the same server. If the transaction is a simple ‘pass through’ that would mean relative lesser processing requirements than a transaction that triggers a set of further operations. If a certain type of transaction triggers for example a series of complex XML based transformations or processing operations, this would mean some level of processing power or memory requirements. A sequence diagram of the transaction would help determine the actual operations that are related to a transaction.

Latency is the additional time spent due to the introduction of a system. NFRs of a system would usually indicate a desired response time of a transaction which a system must then strive to meet. Considering the example above, if a single transaction performs a number of database calls, or a set of synchronous web service calls, the calling transaction must ‘wait’ for a response. This then adds to the overall response time of that said transaction or service call.

Latency is usually calculated via a step by step process – first test response times without the newer systems in place, and then test response times with the addition of the newer systems. The latency vs functionality due to the newer systems is then a tradeoff decision. Techniques like caching can be used to improve latency times.

Capacity calculation
The above are just a few factors that can be used for capacity planning of a system and the importance of these factors vary based on the type of environment. With these factors in place, we also need a set of benchmarked performance numbers to calculate server capacity. For instance, if we know that an Enterprise Service Bus, in certain environmental conditions on certain type of capacity performs at 3000 TPS, then we can assume that a server of similar capacity and operations would provide the same.

The application design and optimisation parameters should also be taken into account as part of the solution. Techniques like caching can help improve performance and latency – this needs to be looked at from a broader perspective. If the service responses change often, then caching wouldn’t make too much of a difference. The cache warm up time needs to be taken into account as well.

It is advisable to have a buffer capacity when allocating server specifications. For instance, allocate 20-30% more of server specifications to that of the peak NFRs to ensure the system doesn’t run out of capacity at peak loads.

Monitoring tools are ideal to calculate a system capacity. Load tests, application and server profiling via monitoring and profiling tools can help determine the current capacity fairly accurately and help pre-identify bottlenecks.

The type of hardware makes a difference as well. Traditional physical boxes are fast being replaced by VMs and cloud instances. The ideal was to calculate capacity if to have benchmarks on these different environments. A 4GB memory allocation on a VM might not be the same as a 4GB memory allocation on a physical server or an Amazon EC2 instance. There would be instances that are geared towards certain types of operations as well. For example, EC2 has memory optimised, compute optimised or I/O optimised instances based on the type of key operation.

As mentioned previously, capacity planning is an art as much as it is a science, and experience plays a huge role in accurate planning of capacity.

October 19, 2014

Webinar – Entity Linking and REST patterns in SOA

Filed under: Uncategorized — mifan @ 4:34 pm

My webinar on Entity Linking in REST patterns in SOA.

The abstract of the webinar is as follows:

“Assumptions are the termites of relationships” – Henry Winkler

A forward-thinking system cannot make assumptions about its entities and their relationships, and Henry Winkler was spot on! Many a distributed system still maintain hard-coded logic on the relationship of services that affect flexibility and adaptability of architectures.

The Semantic web is all about relationships. The web is moving towards a self-describing set of entities, where the linkage between entities is discoverable by applications. From the world of Wikipedia and the myriad of related data, the web is now moving towards massively linked data. Service oriented distributed architectures can learn from these patterns – from composition services that return a link to its related entity with lightweight endpoints to an API facade of REST APIs built in a HATEOAS pattern, the new SOA can be self-discoverable and dynamic, leading to adaptable implementations.

In this webinar, Mifan Careem, director of solutions architecture at WSO2, will discuss

  • How the REST inspired entity linking pattern can be implemented in SOA
  • How the WSO2 platform can be used to implement a loosely coupled, self-describing architecture that involves API facade, service orchestration, and web API design and related patterns, such as Lightweight Endpoints
  • Reference architecture, practical examples, and related research to explain the implementation process

The webinar recording is at the WSO2 site.

April 30, 2014

Connected Government – Cloud Enabling Government

Filed under: Uncategorized — mifan @ 7:41 pm
Tags: , ,

Cloud adoption has had a tremendous impact on e-Government or digital government, leading to reduced operations cost, reduced IT footprint, sharing of knowledge and infrastructure and overall more effective public services. National and local governments that are capitalizing on the cloud infrastructure are starting to reap benefits with improved government to government (G2G), government to business (G2B) and government to citizen (G2C) services.

As applications and their architecture become more complex by the day and as more and more applications start moving towards the cloud, nonfunctional requirements start becoming the key set of requirements that need to be satisfied in order to ensure successful implementation. NFRs have become the key set of issues that enterprise architectects, devops, and implementers face in the move towards cloud-based systems.

This whitepaper on Connected Government – Cloud enabling public services provides an insight into the challenges of building an eGovernment solution, and how an enterprise grade Platform as a Service can help achieve the key NFRs.

February 12, 2014

Operational Business Intelligence for the Reactive Enterprise

We are in a day and age where infrastructure, and to some extent, businesses, are moving towards reactive IT instead of traditional proactive IT. Why reactive IT? Think auto-scaling vs traditional capacity planning for instance. Or the move towards schema-less NoSQL instead of traditional RDBMS. All in all, reactive IT enables an enterprise and its infrastructure to react to its internal and external environment. In order to achieve this, a real-time, or near real time, event driven model is a must –  agents to pull/push streams of events, systems to process these events quickly and efficiently and the ability to use these processed events to react.

Operational Business Intelligence (knowns as OBI or operational BI) or Operational Intelligence is defined as the analysis of operational data and information in an enterprise – this deals with the real time or low latency analysis of streaming events or batched enterprise data providing feedback in terms of input to the enterprise. OI provides organisations with real time insights into enterprise operations, providing organisations the ability to act upon, or in other words react, to events – enabling organisations to ‘listen’ to and process events as they come in, detect anomalies and patterns, and take reactive measures.

Of course, with large amounts of data come big challenges, and with big challenges come big data. With the possibility of dealing with massive data sets within OI, big data concepts have started becoming a mainstay in organisational OI. Modern OI solutions have started focusing on large NoSQL data stores possibly processed in batch mode and streaming events.

OI would provide a unified, correlated view of streaming big data, processed big data, complex events and processes, with the ability to analyse, mine and process data and information – a prerequisite to building a reactive enterprise. Enterprise users and devops have come to expect the following kind of information from a unified OI view

  • Analysis of information, and mining for patterns
  • Adhoc, real time dashboards
  • Adhoc search of patterns across the enterprise
  • Alerting based on event occurences
  • Monitoring of system health, load, KPIs


OI has many technology components, often with shared feature sets. Some of the notable solutions are

  • Business Activity Monitoring (BAM) – Monitoring of activities and events, usually batch processed and provided via dashboards. Used to track  KPIs related to activities and performance.
  • Complex Event Processing (CEP) – Processing of a continuous stream of events, usually in-memory. High performance with the ability to detect certain patterns and anomalies in the incoming streams.
  • Business Process Management (BPM) – Model driven execution of processes and policies, including business workflows with human intervention.

Independently the above components handle a very specific area of OI, and together they provide the building blocks for a comprehensive and unified OI.

In a later post, we will explore how the WSO2 stack, a comprehensive Open Source middleware stack, can be utilised for Operational Intelligence in an enterprise.

May 28, 2013

SSH must-haves for Productivity

Filed under: Development,FOSS,Linux,Uncategorized — mifan @ 9:21 am

Devops work with many different remote systems at once. For the lazy bunch ( a.k.a the truly productive bunch who look for ways to make their work easy – a.k.a the really bright ones ) there are ways to make life easier.

So instead of typing

ssh whitewizard@

(or wait, was it, and then entering the password that no one can remember given to us by the sysadmin, I’d now say

ssh devserver

and voila.

The steps to get there are:

SSH Passwordless Entry

Step one is to get rid of those pesky passwords required each time you SSH into a host. This can be achieved by setting up an RSA (public/private key). And besides, who’d say no to added security?

To generate a SSH key if you don’t have one already, run

mkdir ~/.ssh
chmod 700 ~/.ssh
ssh-keygen -t rsa

You will be prompted for a location to save the keys, and a passphrase for the keys. This passphrase will protect your private key while it’s stored on the system.

Generating public/private rsa key pair.
Enter file in which to save the key (/home/b/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/b/.ssh/id_rsa.
Your public key has been saved in /home/b/.ssh/

Your public key is now available as .ssh/ in your home folder.

Next, the little bit of magic where you’d copy your key over to the remote/host machine. If you can SSH into the machine, then this should be no problem. Run

ssh-copy-id whitewizard@

Done. You can now login by saying

ssh whitewizard@

And the system shouldn't ask you for a password.

SSH Hostname Shortcuts

But wait – we want more (or less, actually). The next step is to shorten this further. For this create a file .ssh/config with the following entries:

Host [shortcut]     
 Hostname [full-hostname]    
 User [username]

I’d use

Host devserver
     User whitewizard

And voila, now running the following will log you into the system

SSH devserver

Of course, replace the above hostnames and usernames with you own – else you’d be login into Saruman’s own server!

May 2, 2013

Real time Complex Analytics for Football

Filed under: Development,WSO2 — mifan @ 6:54 pm
Tags: , ,

Srinath recently wrote about the use of WSO2 CEP for the ACM DEBS 2013 challenge on Real time Complex Analytics which was a real eye opener. The challenge, enabled by sensor networks on player’s shoes, the goalkeeper and the football, was to conduct real time analytics on a football game, and provide useful analytics and real-time reports to the managers.

The post describes the usage of WSO2’s Complex Event Processor (CEP) which was used to implement the use cases of the challenge – namely Running analysis of the players, Ball possession analysis, a heatmap of player locations at various times and shots on goal analysis. CEP is a high performance and scalable event processor that can read streams of ‘data’, extract meaningful events and process them real time in memory – this means the ability to process large amounts of events, fast! In this case, continuous steams of data and events would be fed into the system via the various sensors, at a rate of 15,000 position events per second, whilst the player sensors and the ball sensors output events at a rate of 200MHz and 2000MHz respectively. According the blog, WSO2 CEP processed 50,000 events per second, which is quite impressive.

Just imagine the possibilities such an implementation can provide to the game – I’m awaiting the day when the TV alerts me, possibly 2 seconds before the event, that Robin Van Persie’s shot would have a 99% chance of finding the back of the net beating Petr Cech – based on analytics of the kick (the curvature , wind speed, rotation) and analytics of the defense (the distance of the goalkeeper and probability of him reaching the ball based on historical data, the distance between defenders). Or based on Theo Walcott’s speedy run and Carzola’s immaculate pass, as well as the position of the defense and the keeper, Walcott would end up with the ball beyond the defense in an on-side goal scoring position in the next 3 seconds – the mini siren on the TV goes off, telling me to watch the screen for the next 5 seconds (of course, that is assuming my reaction times are good, let alone the goal keeper’s). And I can hear us hard-core fans of football saying – “who would take their eyes off a football game anyways?”, but what if!

Minority Report for football, anyone?

XKCD Future Comic

Future (Source: XKCD)

April 17, 2013

Clearer Active Tab in Gnome 3 Terminal

Filed under: Uncategorized — mifan @ 7:56 am

I use Gnome on Ubuntu 12.10 and use Gnome terminal as the main terminal. A common issue I faced is the lack of clarity of the active/open tab amongst many tabs open in the terminal window. I use the Ambience theme that comes as default.

A simple fix for this is to create a style in Gnome 3:
Create a gtk.css file as follows, if it doesn’t exist

vim ~/.config/gtk-3.0/gtk.css

Add the following to the file – you can change the color value to any color as required.

TerminalWindow .notebook tab:active {
background-color: #CC6600;

And now you’ve got an active tab that is much more visible

Gnome terminal with custom active tab

Gnome terminal with custom active tab

Next Page »

Create a free website or blog at