Friday, October 31, 2014

An Introduction to HAProxy and Load Balancing Concepts

E An Introduction to HAProxy and Load Balancing Concepts This tutorial is part 1 of 4 in the series: Load Balancing WordPress with HAProxy Introduction HAProxy, which stands for High Availability Proxy, is a popular open source software TCP/HTTP Load Balancer and proxying solution which can be run on Linux, Solaris, and FreeBSD. Its most common use is to improve the performance and reliability of a server environment by distributing the workload across multiple servers (e.g. web, application, database). It is used in many high-profile environments, including: GitHub, Imgur, Instagram, and Twitter. In this guide, we will provide a general overview of what HAProxy is, basic load-balancing terminology, and examples of how it might be used to improve the performance and reliability of your own server environment. HAProxy Terminology There are many terms and concepts that are important when discussing load balancing and proxying. We will go over commonly used terms in the following sub-sections. Before we get into the basic types of load balancing, we will talk about ACLs, backends, and frontends. Access Control List (ACL) In relation to load balancing, ACLs are used to test some condition and perform an action (e.g. select a server, or block a request) based on the test result. Use of ACLs allows flexible network traffic forwarding based on a variety of factors like pattern-matching and the number of connections to a backend, for example. Example of an ACL: acl url_blog path_beg /blog This ACL is matched if the path of a user's request begins with /blog. This would match a request of, for example. For a detailed guide on ACL usage, check out the HAProxy Configuration Manual. Backend A backend is a set of servers that receives forwarded requests. Backends are defined in the backend section of the HAProxy configuration. In its most basic form, a backend can be defined by: which load balance algorithm to use a list of servers and ports A backend can contain one or many servers in it--generally speaking, adding more servers to your backend will increase your potential load capacity by spreading the load over multiple servers. Increase reliability is also achieved through this manner, in case some of your backend servers become unavailable. Here is an example of a two backend configuration, web-backend and blog-backend with two web servers in each, listening on port 80: backend web-backend balance roundrobin server web1 check server web2 check backend blog-backend balance roundrobin mode http server blog1 check server blog1 check balance roundrobin line specifies the load balancing algorithm, which is detailed in the Load Balancing Algorithms section. mode http specifies that layer 7 proxying will be used, which is explained in Types of Load Balancing section. The check option at the end of the server directives specifies that health checks should be performed on those backend servers. Frontend A frontend defines how requests should be forwarded to backends. Frontends are defined in the frontend section of the HAProxy configuration. Their definitions are composed of the following components: a set of IP addresses and a port (e.g., *:443, etc.) ACLs use_backend rules, which define which backends to use depending on which ACL conditions are matched, and/or a default_backend rule that handles every other case A frontend can be configured to various types of network traffic, as explained in the next section. Types of Load Balancing Now that we have an understanding of the basic components that are used in load balancing, let's get into the basic types of load balancing. No Load Balancing A simple web application environment with no load balancing might look like the following: No Load Balancing In this example, the user connects directly to your web server, at and there is no load balancing. If your single web server goes down, the user will no longer be able to access your web server. Additionally, if many users are trying to access your server simultaneously and it is unable to handle the load, they may have a slow experience or they may not be able to connect at all. Layer 4 Load Balancing The simplest way to load balance network traffic to multiple servers is to use layer 4 (transport layer) load balancing. Load balancing this way will forward user traffic based on IP range and port (i.e. if a request comes in for, the traffic will be forwarded to the backend that handles all the requests for on port 80). For more details on layer 4, check out the TCP subsection of our Introduction to Networking. Here is a diagram of a simple example of layer 4 load balancing: Layer 4 Load Balancing The user accesses the load balancer, which forwards the user's request to the web-backend group of backend servers. Whichever backend server is selected will respond directly to the user's request. Generally, all of the servers in the web-backend should be serving identical content--otherwise the user might receive inconsistent content. Note that both web servers connect to the same database server. Layer 7 Load Balancing Another, more complex way to load balance network traffic is to use layer 7 (application layer) load balancing. Using layer 7 allows the load balancer to forward requests to different backend servers based on the content of the user's request. This mode of load balancing allows you to run multiple web application servers under the same domain and port. For more details on layer 7, check out the HTTP subsection of our Introduction to Networking. Here is a diagram of a simple example of layer 7 load balancing: Layer 7 Load Balancing In this example, if a user requests, they are forwarded to the blog backend, which is a set of servers that run a blog application. Other requests are forwarded to web-backend, which might be running another application. Both backends use the same database server, in this example. A snippet of the example frontend configuration would look like this: frontend http bind *:80 mode http acl url_blog path_beg /blog use_backend blog-backend if url_blog default_backend web-backend This configures a frontend named http, which handles all incoming traffic on port 80. acl url_blog path_beg /blog matches a request if the path of the user's request begins with /blog. use_backend blog-backend if url_blog uses the ACL to proxy the traffic to blog-backend. default_backend web-backend specifies that all other traffic will be forwarded to web-backend. Load Balancing Algorithms The load balancing algorithm that is used determines which server, in a backend, will be selected when load balancing. HAProxy offers several options for algorithms. In addition to the load balancing algorithm, servers can be assigned a weight parameter to manipulate how frequently the server is selected, compared to other servers. Because HAProxy provides so many load balancing algorithms, we will only describe a few of them here. See the HAProxy Configuration Manual for a complete list of algorithms. A few of the commonly used algorithms are as follows: roundrobin Round Robin selects servers in turns. This is the default algorithm. leastconn Selects the server with the least number of connections--it is recommended for longer sessions. Servers in the same backend are also rotated in a round-robin fashion. source This selects which server to use based on a hash of the source IP i.e. your user's IP address. This is one method to ensure that a user will connect to the same server. Sticky Sessions Some applications require that a user continues to connect to the same backend server. This persistence is achieved through sticky sessions, using the appsession parameter in the backend that requires it. Health Check HAProxy uses health checks to determine if a backend server is available to process requests. This avoids having to manually remove a server from the backend if it becomes unavailable. The default health check is to try to establish a TCP connection to the server i.e. it checks if the backend server is listening on the configured IP address and port. If a server fails a health check, and therefore is unable to serve requests, it is automatically disabled in the backend i.e. traffic will not be forwarded to it until it becomes healthy again. If all servers in a backend fail, the service will become unavailable until at least one of those backend servers becomes healthy again. For certain types of backends, like database servers in certain situations, the default health check is insufficient to determine whether a server is still healthy. Other Solutions If you feel like HAProxy might be too complex for your needs, the following solutions may be a better fit: Linux Virtual Servers (LVS) - A simple, fast layer 4 load balancer included in many Linux distributions Nginx - A fast and reliable web server that can also be used for proxy and load-balancing purposes. Nginx is often used in conjunction with HAProxy for its caching and compression capabilities Conclusion Now that you have a basic understanding of load balancing and know of a few ways that HAProxy facilitate your load balancing needs, you have a solid foundation to get started on improving the performance and reliability of your own server environment. The following tutorials provide detailed examples of HAProxy setups: How To Use HAProxy As A Layer 4 Load Balancer for WordPress Application Servers on Ubuntu 14.04 How To Use HAProxy to Set Up MySQL Load Balancing

What is the difference between iisreset, recycle, refresh and restart?

iisreset will stop and start the World Wide Web Publishing Service. This, of
course, applies to all of your application pools. I'm sure you noticed a
process being created for each application pool.
This process will handle requests for all websites associated with it.
When you recycle an application pool, IIS will create a new process
(keeping the old one) to serve requests.

Then it tries to move all requests on the new process. After a timeout the old process will be killed
automaticaly. You usualy recycle your application pool to get rid of leaked memory
(you might have a problem in your application if this needs to be a regular operation, even though
it is recommended to have a scheduled recycle). As for restarting a website,
it just stops and restarts serving requests for that particular website.
It will continue to serve other websites on the same app pool
with no interruptions.

Tuesday, October 28, 2014

Get items from SharePoint List using PowerShell script

Please refer below URL

SharePoint: Get list of all users using PowerShell script

Attached script will be used to fetch list of all users on SharePoint site
and also on any specific list using PowerShell script.
Script consits of two functions GetSPWebUsers Using this,
you can get list of all site users,
it will take single parameter (i.e site URL)

Please refer below URL

Thursday, October 16, 2014

The role of the SharePoint Administrator is often a topic that comes up
when beginning to plan out a SharePoint implementation, as it should. The various roles and responsibilities should be clearly defined upfront, but
I often receive the initial feedback from customers that we should be able to just tell them what those responsibilities are. The problem with that
philosophy is that the organization, management, goals, and skill sets of every organization are not the same.
The role of a SharePoint Administrator will vary depending upon your organization.
If you are looking for the SharePoint Administrator to be the "lone wolf" that can support everything you need to get started and that same person
will be solely responsible for keeping the environment running, the list of roles and responsibilities will be different than that of a team approach.
Differences will certainly occur based upon such things as your need to support environments around the clock or the view of how highly sensitive your
data is or if you have a highly-audited environment. Some administrators will be license police, procurement clerks, infrastructure management, farm
administration, back up, recovery support, and help desk. Some organizations have people and roles (part-time to full-time) that have
specializations in each of these areas. Because of the wide variety of organizations, a discussion of decent
length should be undertaken to understand the responsibilities that you consider part of the role. Once you understand what those responsibilities entail,
you can determine if this is just a part-time job duty or a full-time job in and of itself.
In a nutshell, the SharePoint Administrator should be responsible
for the following (though not a standard): .
Managing and checking the overall server health and functionality
Monitoring SharePoint disk space usage through the built-in SharePoint
reports for each site collection Managing SharePoint permissions
Analyzing and reporting upon SharePoint usage and activity
Moving/copying sites
Supporting network load balancing needs and ensuring its correct operation (NLB)
Regular review of the events and messages reported in Event Viewer and Performance Monitor
Regular review, clean-up, management and configuration of SharePoint accounts and sites. This portion of the role will work closely with an Active
Directory administrator if they are separated. Regularly analyzing SharePoint content and storage
Monitoring SharePoint trends (e.g. site usage and growth,
disk space usage and growth) Setting up alerts and enforcing policies
Regularly auditing your SharePoint environment
Identifying and reporting governance violations
Checking for operating system, SQL Server and SharePoint patches and cumulative updates.
In many ways, the SharePoint Administrator has become a jack-of-all-trades.
They are managing services and scheduled jobs within the SharePoint environment, they are creating new sites and lists, installing new web parts,
doing backups, managing the Shared Services, educating users on how to use features like InfoPath, managing governance policies and permissions.
The SharePoint Administrator effectively becomes: Infrastructure engineer
Database administrator
Security administrator
End users licensing expert (Windows, Office, SQL Server, SharePoint, etc.)
Backup and recovery coordinator
Internal guru of all SharePoint capabilities
SharePoint interactive environment expert
Internal help desk
Graphic designer
SharePoint developer
Many of the specific duties must also consider the limitations that Microsoft imposes and should be .
followed to ensure that long-term support is still available from Microsoft. For example, the extent of .
database tuning that you are allowed to do without losing support would be in the allocation of .
databases to drives. If you change any of the database settings (indexes, stored procedures, etc.) then .
you will fall out of support. Similar considerations must also be made when looking at the database as a .
source of information for a data warehouse. If you write any access mechanism that accesses the .
database to pull data out the database, you are no longer under support. In general, a SharePoint .
Administrator is responsible for the general health and well-being of the entire SharePoint environment. .
From a knowledge perspective, the Administrator must have an above-basic level of understanding of: .
Windows operating system and hardware – Basic administration of a server including service packs and .
hot fixes. .
General knowledge of networking – IP, DNS, Load Balancing as well as the concepts of Availability, .
Scalability, and Maintainability. This person should also understand firewalls, encryption and security .
zones. .
Internet Information Server (IIS) and the basic operation of websites, Application Pools, IIS .
Administration, the IIS Metabase, Ports, SSL Certifications (security certificates and wildcard certificates) .
Microsoft SQL Server - Basic operation, tuning, transaction log selection, backup and recovery, and .
maintenance planning. Since SharePoint is completely supported by a Microsoft SQL Server database, .
the SharePoint Administrator is expected to be knowledgeable at the database level. .
SharePoint working knowledge of Central Administration, STSADM, and more so now, the PowerShell .
administration modules. SharePoint Event Log troubleshooting, search administration and .
troubleshooting, concepts of a farm and the planning and implementation of Service Packs and .
Cumulative Updates. .
Debugging skills and techniques for each of these areas identified above – troubleshooting issues can .
occur within or across one-to-many of these areas. .
In other words, a good SharePoint Administrator is a self-contained IT Department. Imagine the job! .

Now that I've pleaded the case that the SharePoint Administrator must be a key and important player
within your IT department, let me layout some regular or recurring duties that this person would, or
should perform. This may help you in planning how much time this person would spend performing
these tasks.

One-time / First-time Farm Activities
1. Determine general patch approach for applying patches
2. Windows O/S (Windows Update)
3. SQL Server (Service Packs
4. Document the overall system architecture
5. Document the disaster recovery plan for data center, server, or document recovery
6. Determine search architecture (What is indexed?, how often?, etc.)
7. Determine design continuity (What templates are used for each area)
8. Determine best practices for creation of Sites, Site Collections, and content databases
9. Determine strategy for business intelligence in SharePoint (upon dashboards, where is
the data stored?, how is it presented?, etc.)
10. Create SharePoint Service Level Agreement
11. Create best practices document for taxonomies
12. Create best practices document on security configuration
13. Create SharePoint roles document
14. Determine who can access the site (internal only? customers?)
15. Determine how partners and users will navigate the sit
16. Determine the process to request a site
17. Determine the process to request access to sites
18. Create best practices document to explain how and when to publish a document to a
global audience (should they be PDFs?)
19. Create feedback and/or suggestion mechanism for site enhancements
20. Determine naming conventions
21. Develop process for FAQ (users and help desk)
22. Develop training process

Daily Activities

1. Review Windows Event Logs for high-priority issues
2. Review the SharePoint Logs for high-priority issues

Weekly Activities

1. Review Search Usage reports
2. Attempt searches upon typical end-user searches – verify they work properly
3. Verify Alerts are functioning properly
4. Enhance search through audit of Search patterns (implementation of noise words, best bets,
keywords, thesaurus entry, etc.)
5. Review and maintain current BI cubes and web parts (if applicable)
6. Audit server utilization (disk IO, disk space, CPU, etc.) and update baseline 7. Review past week questions and issues and update FAQ
8. Ensure off-site backup procedure working properly

Monthly Activities

1. Review overall server architecture based on current use
2. Audit individual server design (each server)
3. Review released patch list for Windows Operating System, SQL Server and SharePoint
4. Apply patches per the pre-defined patch approach
5. Review patches or maintenance to third party controls (web parts, iFilters, etc.)
4. Review overall server architecture diagrams and documentation for updates and revisions
5. Review search architecture for new areas to index, crawl or exclude
6. Report on SharePoint uptime and SLA compliance
7. Review security hierarchy
8. Review new functions or sites deployed. Determine if training needs to be updated
9. Verify backups are valid and contain data
- See more at:

Thursday, October 9, 2014

User Profile Synchronization Service Gets Stuck on Status Starting

I recently came across this issue
when provisioning the User Profile Service in SharePoint 2010.
For some reason once you provision the User Profile Service Application
the User Profile Synchronization Service gets stuck on Starting, and
it can’t be stopped in Central Administration. This is apparently
a very common issue and I have even heard of people re-building SharePoint
Servers to fix the issue. But from my experience that’s not really necessary. First of all to stop the User Profile Synchronization Service you need to run a Powershell Command.
Open up Powershell on your SharePoint Server and type in the following command

Image Link:

This will list out all of the services on your SharePoint Server with their associated GUID’s. Copy the GUID for the User Profile Synchronization Service. Then run the following command to stop the User Profile Synchronization Service. Stop-spserviceinstance

Image Link :

Now go back into Central Administration > Application Management > Manage Service Applications and delete the User Profile Service
Application. Restart your server and set up
the User Profile Service Application again.

Error Message: CreateListLocation:: : An error occurred while parsing EntityName. Line 26, position 61.

Hi everyone,
We have updated versions of the product available for 2007 (version 2.4.50), 2010 (version 2.4.57), and 2013 (2.4.65) available now for download here:

Both the MSN and Yahoo weather feeds should be working correctly in all three versions.
We are still working on getting an update to the SharePoint App, but we hope to have that completed soon.
If you see any problems after updating to the new release, please let us know.
Thanks again for your patience and understanding while we worked through these issues.
Regards, Param

Google+ Followers