Friday, December 3, 2010

Improvement in Server Performance

Why is my website taking so much time to load?

One of the common reason could be due to growth in site's traffic… Now the question is what should be done to make the site faster. Is it to add additional hardware components or is there something to deal with software? Lets check it out...
First lets start examining the processes which are running on the server. In my case I found that CPU was showing 100% usage with one process called "W3WP.EXE" consuming the highest memory. W3WP.EXE is an IIS web server’s worker process



Now I started digging why W3WP.exe process is consuming so much memory.  The solution is actually very simple, but first a little background information.

What is the W3WP.exe process?


The W3WP.exe is the IIS worker process, that handles requests, maintain sessions, viewstate, and the cache.  Its been around Since IIS 6 on Windows Server 2003, and is still found as part of IIS 7.5 with Server 2008 R2.  On a properly configured, and programmed website the W3WP.exe can usually stay under 100 Megs.   If you are running a 64bit OS it could be a little larger.  The actual size of the W3WP.exe will be determined by how much traffic a website gets, and how many pages it serves.  The 100 Meg figure is just an estimate from my own experiences.  Application Pools with multiple websites can easily go over this figure, so don't use it some magic number. 



Most popular causes of W3WP.exe using too much memory


Page Caching Dynamic Websites


Some Programmers will use Page Caching on their ASP.NET pages to improve request speeds. Even though this does work.  It will quickly eat up all your memory.  For Page Caching to work you would need to cache each page and every combination based on its querystring variables.  For Members sites this could result in millions of different pages.  A more effective way of using caching is to Cache objects that do not change, and are used throughout the website.  Things like static comtent, your menu bar, header and footer etc.  Or maybe the details for an event.  This will reduce the number of calls to the Database Server, and speed up your site.  Some may argue that the function of a Database server is to cache popular queries, and that there is no difference between retrieving the data from the database server and caching the objects in your web server's memory.  This is absolutely false for many reasons.  First anytime your website has to retrieve data from the database, it has to open a connection to another process, even if this process is running on the same box as the web server there is a very small performance penalty to establish this connection.  What if your DB server is in a datacenter which is somewhere else.  So now your web server has to reach across the datacenter to a separate server.  At this point the latency of their network becomes an issue.  This is the reason I highly recommend doing everything you can to reduce the calls to the database.  Object Caching can make a huge difference on page load times, especially when you are able to cache objects that use expensive queries. 

ViewState Enabled on Labels


The ViewState is how ASP.NET keeps track of changes that have been made to Web Controls.  ViewState is needed anytime you are going to do a postback, like for a submit form.  But a common mistake is programmers don't disable viewstate on Label controls that are often used as place holders for long concatenated HTML strings.  If you suspect your may be guilty of this all it takes is a look at the HTML source code from your web browser to confirm it.  If your HTML source looks like this








with a really big view state then you need to disable the viewstate on your label controls.  The Viewstate is stored in the W3WP.exe process.  Its easy to see how this process can consume so much memory when you have a view state this large and on an exponential number of web pages. The solution is to change your ASP:Label Controls from this

<asp:Label ID="mainmenu" runat="server" />
to this
<asp:Label ID="mainmenu" EnableViewState="false" runat="server" />


You can also disable the viewstate of complete page under its header as below

<%@ Page EnableViewState=”false” EnableSessionState=”ReadOnly” ...%>


Lets face it there is no reason you need to preserve the ViewState of a Label Control.  So go through all your pages and add the EnableViewState="false" attribute to all your pages.
Here you can also see that we have additionally disabled session state.This is with assumption that since Session is accessed for read only then we can set it as read only saving on locking and preventing race conditions.




Unclosed Database Connections


If you use helper functions to manage your Database connections, be sure that you close the connections, when finished.  Else this will waste memory on both the W3WP.exe side and the Database Server side.


Conclusion


Thus by doing a little cleanup work as above, we can get decent improvement in our server responses without adding any servers.

Thursday, February 18, 2010

SMSCountry Excel Filter Feature

Condition I




Condition :- I want to send SMS to those clients whose Buy Quantity is between 500 and 3000.

Case Study:- It can be done through manual selection if you have very few records, may be up to 10. But what if you have 100 or 1000 or more records all scattered. You cannot spend your time searching for those users.

Hence here is the right solution for you...








Solution :- Click “Filter” and Enter Filter Formula.

Formula :- X [ Y] where
-> content inside [ ] are optional and can be repeated if required).
-> X and Y = ##

Example :- #G# > 500 and #G# < 3000
Finally click on “Ok” followed by “Send”



Following confirmation box will be displayed





Condition II




Condition : I want to send SMS to only those users whos symbol is “TATASTLCCPS”

Case Study: In above sheet only “Basheer” and “Ramesh Ankam” should receive SMS. But what if there are 1000 scattered records in the sheet out of which 250 satisfies this condition.

So here is the right solution for you...








Solution : Click “Filter” and Enter Filter Formula.
Example : #F# = ‘TATASTLCCPS’
Finally Click on “Ok” followed by “Send”


Following confirmation box will be displayed








Condition III




Condition : I want to send SMS only to a particular series of mobile numbers say "9198663".

Case Study: It is very difficult to compare each mobile number with the given series. In the above example after carefully examining we can say that “Ramesh Ankam” and “Saif” should receive an SMS. But what if the sheet contains thousands of records.

Here we bring the perfect solution for you...









Solution : Click “Filter” and Enter Filter Formula
Example : #C# like ‘9198663%’
Finally Click on “Ok” followed by “Send”


Following confirmation box will be displayed






Here in the above presentation, I have shown you only three different examples of using Filter. There can be many more cases where filters can be applied.

Ex: comparing dates, age, special characters, words, etc...



THE END.

Tuesday, February 16, 2010

Excel Plugin Application-defined or object-defined error

Dear SMSCountry Excel Plugin User,

If you are getting the following Error while send SMS from SMSCountry Excel Plugin "Application-defined or object-defined error" then please perform the following checks to resolve this issue.

Every Excel Sheet has got a unique Identity for every column as its column heading ex: A B C ... till ZZ.Inorder for us to specify column name in our excel software, we have used #A# instead of just specifying A to differentiate it from normal english characters. Since # is used by us as reserved character, issue arises when your message also as # in it.




Cause Of Error :-
The above picture shows you error which might occur when you are using #(hash) character in your message.

Solution :-
Please try sending SMS after removing # character from SMS Message...

Ex:-(Below message gives you error in Excel Plugin as Application-defined or object-defined error since there is # repeated in your message too.)
Dear #B#
Your Account # is #C#
Your Balance is #D#

To resolve the erroe you can edit message as.
Ex:-
Dear #B#
Your Account No. is #C#
Your Balance is #D#


I have removed # character from message and it works fine. As shown in above image.

That's it for this topic. If still that doesn't help then let me know so that I can give you some more solutions for it.

Thursday, February 11, 2010

How To Change The Column Heading(Identity) In MS Excel

Dear Friends,

As we all know that excel sheet will have column headings using which we perform all mathematical operation, formulas etc. The headings can be A,B,C,...ZZ format or 1,2,3....etc. Depending on our requirement we can change these using excel settings. Mostly in case of performing mathematical calculations using formulas, we prefer to have column headings as characters instead of numbers. Here I will show you "How To Change The Column Heading(Identity) In MS Excel" from numbers to characters and characters to numbers.

You just need to follow the below steps to change your Microsoft Excel Column Headings from A,B,C... to 1,2,3... or vice versa.

How To Change The Column Heading(Identity) In MS Excel


1) Open Excel Sheet

2) Click on Excel Office Button (Top Left most) then

3) Click on "Excel Options" then
You will get an "Excel Options" Interface.

4) Click on "Formulas" (at left side) then

5) UnCheck "R1F1 reference style" then (For Alphabetic Rows)
OR
5) Check "RR1F1 reference style" then (For Numeric Rows)

6) Click on "Ok"

Thats it, you have successfully converted your Excel Sheet column Identity from 1,2,3.... to A,B,C...


Please refer the snapshots for the same.








Let me know if you have any queries in this regard

Monday, February 8, 2010

SMSCountry Excel Plugin Grouping Feature

What is Grouping?
Grouping refers to merging of same type of data into single place. In our case it refers to merging same type of records in to one.

What are the advantages of Grouping?
1) Lowers the SMS cost to sender.
2) Avoids unnecessary repetition of data.
3) Makes SMS reading simple, easier & comfortable for the receiver.



Problem: I want to send SMS to all my clients listed above.
Using normal procedure I will be charged for 11 SMS for sending message even to repeated clients. Instead I need a solution with which I can send all corresponding data to its client in a single SMS. This will help me in:

1) Saving SMS cost as it would charge me only 3 SMS or 6 SMS for long message instead of 11.

2) Also it would be easier for my client to read all his data in a single message instead of opening separate messages.
Lets see how we will implement this ?????????????????



Solution : Grouping
STEPS TO SEND GROUP SMS :-
step 1: Sort your data according to client id (column F) or mobile number (column G)

Step 2 : Enter Message-> row range,->select mobile number column,->Advance Option & Preview check box ->select Unique Column(Group by column) with which you want to Group, Enter Header Text & Footer Text which you don’t want to repeat and Click on Send.




You will be prompted if your message has characters > 160.

Click “OK” to continue sending long SMS.




A Preview dialog will be displayed with customized SMS text. Here it shows 3 SMS will be pushed with each SMS more than 160 characters in length. So total 6 SMS cost will be charged.




You can view each SMS details by using “Next SMS >>”
and “<< Previous SMS” buttons.

Click On “Send SMS” shall directly proceed to sending SMS.



On successful sending of SMS, you will see an SMS Sent Confirmation dialog.




THE END.

Tuesday, February 2, 2010

SMSCountry Excel Preview Feature


Feature Discussed :- “Preview”



Why Preview is required?

As SMSCountry provides customized bulk messaging from Microsoft Excel Plug-in, one must know how the message will appear after customization.

Preview Feature provides following facilities:-

1) Displays exact message which will be forwarded to the recipient along with mobile number.

2) Shows number of characters message contains.

3) Number of SMS’s clubbed into single SMS.

4) Total number of SMS’s selected for sending SMS.

5) Total number of SMS’s charged.





Problem: I want to send SMS to all my clients listed above.
From above data we can say that 12 SMS will be required to send the details.
But there are some clients who have more then one transaction ex:- “CJR009” .
Hence we can use “Advanced feature” to group all his records in to single SMS.


Lets check...
...
..



Enter the Message -> specify the row range -> select Advanced Options -> select “Preview and Send” -> Click on “Send” button (as shown above)



Until now we were unknown of how actually the sms is grouped into one and how does it appear to the client once sent.




So, here is the solution for you...





On selecting the option of “Preview and Send”, a dialog will appear that displays each and every SMS message in exact format as it appears on receivers mobile.




You can view each SMS details by using “Next SMS >>” and “<< Previous SMS” buttons.
Click On “Send SMS” shall directly proceed to sending SMS.



Next Example :

“Preview” with “Filter Feature”






Suppose I have hundreds of records in my sheet. According to my filter formula “#G# > 600” I don’t know how many SMS will be sent and to whom it will send.

In such case, here is the solution.




You can proceed sending using “Send SMS” button or click “Cancel” to cancel all the messages.

THE END

Monday, February 1, 2010

Automatically Forward Emails From Outlook Express 6

Following are the steps to forward emails from Outlook Or Outlook Express!!!

In Outlook Express: (6)



  1. Click on the Tools menu and select Options.

  2. In options select the Send tab.

  3. Make sure the settings for Mail Sending Format has the Plain Text radio button Selected.

  4. Then click the Plain Text Settings button.

  5. Leave the Message format on “MIME”.

  6. Uncheck the box at the bottom that says “Indent the original text with…”.

  7. Click OK.

  8. Now click on the Signatures tab.

  9. Make sure if you have a signature(s) listed that the box labeled “Don’t add signatures to Replies and Forwards” is checked. Then click OK.

  10. Click on the Tools menu and select Message Rules, and then select Mail.

  11. Click on the Mail Rules tab.

  12. Click the New Button.

  13. In the area labeled 1. Select the Conditions for your rule: Select the box next to Where the Subject line contains specific words (in this example we will use the subject but you could use account or email address if desired).

  14. Then in the area labeled 2. Select the Actions for your rule: Select the box next to Forward it to people.

  15. In the area labeled 3. Rule Description… click on the blue link that says “contains specific words” then type your member code in the box and click on the Add Button and then click OK.

  16. Then in the same area click on the blue link that says “people”, then type in the email address(Ex: < MobileNumber >.< Your SMSCountry Username >@smscountry.net or xyz@gmail.com ) of where you want the email to automatically forward to and then click OK.

  17. Click OK.

  18. Click OK.


In Outlook (2003)


1. Click on the Tools menu and select Options.
2. In options select the Mail Format tab.
3. Make sure the settings for Message Format is using the Plain Text option.
4. Under the Select Signatures for account area at the bottom of that window, make sure
that is listed in the menu for the option of Select Signature for replies and
forwards. Then click OK.
5. Click on the Tools menu and select Rules and Alerts.
6. Click on New Rules.
7. Click the Start from a blank rule radio button. Then click Next.
8. Select the box next to With specific words in the subject (in this example we will use
the subject but you could use account or email address if desired).
9. In the area labeled Step2: Edit the rule description… click on the blue link that says
“specific words”, then type your member code in the box and click on the Add Button
and then click OK. Then click Next.
10. Select the box next to forward it to people or distribution list.
11. In the area labeled Step2: Edit the rule description… click on the blue link that says
“people or distribution list”, then type in the email address of where you want the
email to automatically forward to and then click OK. Then click Next.
12. Then click Next.
13. Then click Finish.
14. Click OK.

SMSCountry Excel Template Feature



New Feature:- “Save Your Message” (Save Msg)



Description & Use Of This Feature


This feature allows user to save his/her message into our database and access it whenever & wherever needed. This is very similar to mobile phone templates(sample messages) concept except that here user can decide the message text.

Save once, Use Everytime:-
As many users have common sms format, they can save it once and use it everytime. Thus saving their time too.



Additions in UI (Save Msg)

Check Box as “Save Msg”.

Button as “Display Saved Messages”.

Text Box as “Enter Msg Name”

Drop Down List as “Select A Message”





How to save your message?

1) Enter your message in message text area.

2) Select “Save Msg” Check box. This displays “Enter msg Name” Textbox and a button “Save”.

3) Enter your desired name in the field provided.

4) Click On Save Button.

5) You will get an alert saying “Successfully Added”





How to View Saved Messages?

To view your saved messages : -


Click on “Display Saved Messaged” Button.

You will be prompt to Login (if not already).

Once logged in you can view all your saved Messages in a drop down list called “Select a message”.

Once you select a message name , the corresponding message will get displayed in the message area.

Saturday, January 30, 2010

New Line Character's Character Count

Dear All,

Each New Line character(Enter Key) occupies 2 character space.



A newline(Enter Key), also known as a line break or end-of-line (EOL) character is a special character. It actually contains sequence of characters for some configurations(OperatingSystem + Application) signifying the end of a line of text.



The name comes from the fact that the next character after the newline will appear on a new line—that is, on the next line below the text immediately preceding the newline. The actual codes representing a newline vary across operating systems, which can be a problem when exchanging data between systems with different representations.



In above example I have entered
"Hi< NewLine >< NewLine >Bye" that means total 7 characters if we consider "NewLine" character as single character..... till now this is what we think.

I have selected preview option and clicked on Send.



Here in above image character count says
9 character, because each "NewLine"(Enter Key) character occupies 2 characters.


How To Use New Line In Different Programming Languages


VB : vbCrLf
VB.Net : vbCrLf
C & C++ : "\n"
HTML : "< b r />"



Now what does CrLf means!!


The Unicode standard defines a large number of characters that conforming applications should recognize as line terminators:


LF: Line Feed, U+000A
CR: Carriage Return, U+000D
CR+LF: CR (U+000D) followed by LF (U+000A)
NEL: Next Line, U+0085
FF: Form Feed, U+000C
LS: Line Separator, U+2028
PS: Paragraph Separator, U+2029


LF – Line feed


The line feed character is one of the characters in the ASCII character set that has been misused. Originaly, the LF character was ment to move the head of a printer one line down. A second control character CR would then be used to move the printing head to the left margin. This is the way it was implemented in many serial protocols and in operating systems like MS-DOS and Windows. On the other hand the C programming language and Unix operating system redefined this character as newline which ment a combination of line feed and carriage return. You can argue about which use is wrong. The way C and Unix handle it is certainly more natural from a programming point of view. On the other hand is the MS-DOS implementation closer to the original definition. It would have been better if both line feed and newline were part of the original ASCII definition because the first defines a typical device control functionality where the latter is a logical text separator. But this separation is not the case. Nowadays people tend to use the LF character mainly as newline function and most software that handles plain ASCII text files is capable of handling both single LF and CR/LF combinations. The control character is in the programming language C available as \n.

CR – Carriage return


The carriage return in the ASCII character set in its original form is ment to move the printing head back to the left margin without moving to the next line. Over time this code has also been assigned to the enter key on keyboards to signal that the input of text is finished. With screen oriented representation of data, people wanted that entering data would also imply that the cursor positioned to the next line. Therefore, in the C programming language and the unix operating system, a redefinition of the LF control code has taken place to newline. Often software now silently translates an entered CR to the LF ASCII code when the data is stored.