w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
While Sending Html Mails from my web application Recieved Mails contains Symbols like &ldquo,&rdquo, ‘
Check with another constructor for htmlView: ContentType mimeType = new System.Net.Mime.ContentType("text/html"); var htmlView = AlternateView.CreateAlternateViewFromString(bodyMessage, mimeType);

Categories : Asp Net Mvc

Why doesn't Nginx load balancing balance bandwidth?
It sounds like the configuration is doing exactly what you asked it to do. You configured a proxy on the first server IP, right? So data has to go from the user to the proxy, then to the server, then the reply from the server back to the proxy and then to the user. It's triple because the first server sees three flows (both servers' output from the proxy and the second server's input to the proxy) while the second server sees one (its output to the proxy). It is perfectly balancing the traffic into equal flows, the first server just sees three flows and the second just one. As for how you fix it, it depends what's wrong with it and what you're trying to accomplish, which you haven't told us.

Categories : Nginx

Haskell: sub-optimal parallel GC work balance, no speedup in parallel execution
The varaition is likely due to the fact that using +RTS -Nn leads to creation of one bound thread and n worker threads (cf. the output), hence one worker will share a physical core with the bound thread and interfere. Hence, it is recommended to use a number lower then the total number of available physical cores as argument for +RTS -N. Another potential issue is load balancing: you may need to split the work differently if there is load unbalance (threadscope profile would help). Have a look at this paper for more details on tuning.

Categories : Multithreading

Make nginx load different locations for PC and mobile devices
The problem is as indicated: the location directive is not allowed inside an if. There are actually only a few things that are safe to do within if directives, examples are rewrite and return. See the documentation for more detailed information. Something the documentation doesn't mention is that under certain conditions set is also safe to use. In your specific case, try something like this: if ($http_user_agent ~* android) { rewrite ^ /mobile/$request_uri last; # internal rewrite } location /mobile { } Note that I haven't verified your regular expression. I am sure you can tweak that according to your needs.

Categories : Nginx

Cache CSS and Javascript in the background or load it from the application
One way to do it would be using HTML5 localStorage. Something like this (not tested): function loadScripts() { var scriptURL = '/myscript.js', cssURL = '/mycss.css', jsXHR, cssXHR; var applyStyleAndScript = function(styleText, scriptText) { var styleTag = document.createElement('style'), scriptTag = document.createElement('script'); styleTag.innerText = styleText; document.body.appendChild(styleTag); scriptTag.innerText = jsText; document.body.appendChild(scriptTag); } if (localStorage && localStorage[scriptURL] && localStorage[cssURL]) { applyStyleAndScript(localStorage[cssURL], localStorage[scriptURL]); } else { cssXHR = new XMLHttpRequest();

Categories : Java

Amazon web service load balancer unable to balance the load equally
There could be a number of reasons for this. Its without doing more digging, its hard to know which one you are experiencing. Sticky sessions can result in instances traffic becoming unbalanced. Although this depends heavily on usage patterns and your application. Cached DNS resolution. Part of how the ELB works is to direct traffic round robin on a DNS level. If a large number of users are all using the same DNS system provided by an ISP, they might all get sent to the same zone. Couple this with sticky sessions and you will end up with a bunch of traffic that will never switch. Using Route 53 with ALIAS records may reduce this somewhat. If you can't get the ELB to balance your traffic better, you can set up something similar with vanish cache or other software load balancer. Not as c

Categories : Amazon

Sencha Touch: load data into store from HTML application cache?
Found the solution from looking into the API documentation and doing a bit of trial and error with properties. It is not obvious at all. The problem was, the requests for the .json files was being appending with additional arguments, ?dc=XXXXXXX and paging arguments. There are two additional properties that need to be applied to the proxy: noCache and enablePagingParams. This did the trick. var myStore = Ext.create("Ext.data.Store", { model: "User", proxy: { type: "ajax", url : "/users.json", noCache: false, enablePagingParams: false, reader: { type: "json", rootProperty: "users" } }, autoLoad: true }); I also needed to update the header comment on my test cache.manifest file, to ensure that the cha

Categories : Json

How to make two Application Modules share the same entity cache?
In the configuration you are using each AM uses a separate connection to the DB - you can't share the cache between them. You need to implement nested Application Modules - where one AM is inside the other. See the documentation for more.

Categories : Java

Set expires to max for all images of all servers in nginx
Try it first cause I haven't tested this before. conf file /etc/nginx/img-cache.conf for example location ~* .(jpg|jpeg|png|gif|ico|css|js)$ { expires max; } server server { #bla bla include /etc/nginx/img-cache.conf; #bla bla }

Categories : Caching

How to configure proxy servers with puppet nginx?
Use nginx::resource::vhost The source of the repo you are using gives a breakdown of the commands you will need to use: https://github.com/puppetlabs/puppetlabs-nginx/blob/master/manifests/resource/vhost.pp

Categories : Nginx

Load Balance wso2 ESB
You can add following parameter to http and https transport receivers of WSO2 ESB . <parameter name="WSDLEPRPrefix" locked="false">[load-balancer-url]</parameter> For example: <parameter name="WSDLEPRPrefix" locked="false">http://esb.cloud-test.wso2.com:8280</parameter> You need to edit following file. <WSO2-ESB-HOME>repository/conf/axis2/axis2.xml This step is necessary for configuring WSO2 ELB also. See following ELB doc for more information. http://docs.wso2.org/wiki/pages/viewpage.action?pageId=26839403

Categories : Wso2

maintaining cache state in different servers
Any way you like ;) If you have no idea, I suggest you look at or use ehcache or Hazelcast. It may not be the best solutions for you but it is some of the most widely used. (And CV++ ;) I suggest you understand what it does first.

Categories : Java

Nginx return file when it's in cache/check if file exists in cache
Ok, maybe not so beautiful solution but upstream can be used with one server makred as down. http { upstream backend-jail { server 0.0.0.0 down; } server { listen 80; underscores_in_headers on; recursive_error_pages on; error_page 597 = @jail; location / { if ($http_x_backend_down = "1") { return 597; } proxy_pass http://lcoalhost:8080; proxy_set_header Host $host; proxy_cache my-cache; proxy_cache_valid 200 302 1h; proxy_cache_valid 404 1m; proxy_cache_key $uri$is_args$args; } location @jail { # dont need to log error about 'no live upstreams' error_log /dev/null crit; # backend-jail always return 502, want 404 to be return

Categories : Caching

Load Balance: Node.js - Socket.io - Redis
Redis only syncs from the master to the slaves. It never syncs from the slaves to the master. So, if you're writing to all 3 of your machines, then the only messages that will wind up synced across all three servers will be the ones hitting the master. This is why it looks like you're missing messages. More info here. Read only slave Since Redis 2.6 slaves support a read-only mode that is enabled by default. This behavior is controlled by the slave-read-only option in the redis.conf file, and can be enabled and disabled at runtime using CONFIG SET. Read only slaves will reject all the write commands, so that it is not possible to write to a slave because of a mistake. This does not mean that the feature is conceived to expose a slave instance to the internet or

Categories : Node Js

Azure windows virtual machine load balance
You need both the virtual machines to be under the same cloud service. Only then you get the option to load balance them. There is no way add existing VMs to the same network. there are operations in the Service management API (usable through powershell) to create a new VM. You can use that to create a fresh VM from your existing image and connect it to the same service as your first VM. Then you'llhave the necessary options enabled for load balancing.

Categories : Azure

Azure Traffic Manager Load Balance Options
Traffic manager comes into picture only when your application is deployed across multiple cloud services within same data center or in different data centers. If your application is hosted in a single cloud service (with multiple instances of course) , then the instances are load balanced using Round Robin pattern. This is the default load balancing pattern and comes to you without any extra charge. You can read more about traffic manager here: https://azure.microsoft.com/en-us/documentation/articles/traffic-manager-overview/

Categories : Azure

How to broadcast cache invalidate messages to all servers running a web app?
Two options come to mind. The first is to use Amazon SNS, which can use SQS as a delivery backend. This might be overkill, though, since it's designed as a frontend to lots of delivery types, including e-mail and SMS. The approach I'd try is something along the lines of Comet-style push notifications. Have each machine with a cache open a long-lived TCP connection to the server who's responsible for handling updates, and send a compact "invalidate" message from that server to everyone who's listening. As a special-purpose protocol, this could be done with minimal overhead, perhaps just by sending the object ID (and class if necessary).

Categories : Java

Does SQL Server Service Broker load balance when External Activator is used?
To utilise the built-in load balancing you would need to deploy the service to more than one sql server instance. I suspect that isn't quite what you are planning, so you will have to come up with a custom method, such as having an internal activated procedure that forwards your arriving messages into one of your four queues that the external activation processes look at.

Categories : Sql Server

how to make javascript load new data every time (without using cache data) when I redirect it to a handler(page) on mouse click
if you have access to target page, you can use following meta tags in target page to disable caching. <head> <meta http-equiv="cache-control" content="max-age=0" /> <meta http-equiv="pragma" content="no-cache" /> <meta http-equiv="cache-control" content="no-cache" /> <meta http-equiv="expires" content="0" /> </head>

Categories : Javascript

how to internally load balance multiple instances of web/worker roles in Azure?
There is no internal load balancer in Windows Azure. The only load balancer is the one that has the public IP Addresses. If you want to load balance only internal addresses (workers) you have to maintain it yourself. Meaning you have to install some kind of a load balancer on Azure VM, which is part of the same VNet. That load balancer may be of your choice (Windows or Linux). And you have to implement a watchdog service for when topology changes - i.e. workers are being recycled, hardware failure, scaling events. I would not recommend this approach unless this is absolutely necessary. Last option is to have a (cached) pool of IP Endpints of all the workers and randomly chose one when you need.

Categories : Asp Net

How to disable nginx cache
Solved my problem... Installed manually following this steps: http://eksith.wordpress.com/2008/12/08/nginx-php-on-windows/ with pure nginx i could disable cache on nginx.conf

Categories : Caching

Make two amount inputs equal to a balance input on blur
I feel you need this solution if(amount1 + amount2 != balance){ $('input[id*="amount"]').not(this).val(balance-inputVal); } Please try with this http://jsfiddle.net/ashukasama/n23mB/

Categories : Jquery

Managing Nginx FastCGI cache files
From reading http://nginx.org/en/docs/http/ngx_http_fastcgi_module.html#fastcgi_cache_path I would note that cache size and contents are managed through following options to fastcgi_cache_path directive: inactive: "Cached data that are not accessed during the time specified by the inactive parameter get removed from the cache regardless of their freshness. By default, inactive is set to 10 minutes." So I would suppose that with default settings all files that were not accessed within last 10 minutes should be removed; max_size: "The special cache manager process monitors the maximum cache size set by the max_size parameter. When this size is exceeded, it removes the least recently used data.". I would guess that you do not have max_size limit set at all. So with large number of objects

Categories : Nginx

How can I optimize this nginx proxy cache configuration?
A nested location is the right way to create locations with regular expressions and it should do the trick for what you want to achieve. location / { proxy_pass http://192.168.12.12:91; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; location ~* .html$ { proxy_cache cache_one; proxy_cache_key $host$uri$is_args$args; proxy_cache_valid any 1m; expires 1m; } } I’m not totally sure if the nested location is really using the options from the outer location block. If it doesn’t (I can’t test this right now) you could create separate files. location / { include proxy.conf; location ~* .html$ {

Categories : Linux

How to make a windows phone application load faster like default applications?
Windows Phone 7 On Windows Phone 7 it's not possible to make a 3rd party app perform like the built-in apps such as People, Pictures, Calendar, Games, Music+Videos, etc. Those apps are mostly likely written in C++ and are natively compiled, have special permission to run in the background (so they resume instantly), and have full OS/hardware access. 3rd party apps (ie. the apps you and I can write) are compiled against the Silverlight platform which is not as performant as natively compiled C++ code, which is why even a simple app with no splash screen and a single TextBlock will take longer to load than, say, the built-in Games app (and not feature the proper entrance animation). So, all you can do is try and make your app startup as fast as possible, given the circumstances. There ar

Categories : C#

Nginx: Response handling and Reverse Proxy with Cache
Actually, location.capture is not designed to do things you doing, but, if I get you correct (you want to send headers that browser send you to subrequest) you, probably, can hack it around using ngx.ctx + set ;) But I'd say it is a very dirty kludgy way.

Categories : Nginx

Nginx set separate browser cache expiry for Index pages
Got the answer finally. had to go through the nginx working manual. Handling a request “/” is more complex. It is matched by the prefix location “/” only, therefore, it is handled by this location. Then the index directive tests for the existence of index files according to its parameters and the “root /data/site” directive. If the file /data/site/index.htm exists, then the directive does an internal redirect to “/index.htm”, and nginx searches the locations again as if the request had been sent by a client.. so i had to add one more location to search for my index.htm file location ~* index.(htm|html)$ { expires 1d; root /data/site; index index.html index.htm; }

Categories : Nginx

How to speed up delivery for static files with nginx? (Cache them in memory?)
Assuming you have enough memory in your system, the css file should be being cached by the operating system. I'd put multi_accept on; in the events section but otherwise your config looks fine. Nginx should be serving your css file gzip'd and quickly. I'd be inclined to test it with another file and also see how it compares with proxying the file from Apache. I have a feeling your problem is not where you think it is.

Categories : Caching

php cookies on load balanced web servers
The cookie doesnt care what backend server handles the request, unless the url changes. If the url changes from www1.xxx.xx to www2.xxx.xx then you could save the cookies with the path included (xxx.xx) and both subdomains will be able to see the cookie. Another thing that is more likely to go wrong is that the sessions arent shared between both servers. You could use memcached for this.

Categories : PHP

PHP SESSION is NOT SAME (Not-in-Synced) in load-balanced Servers?
If you are using the default file-based session storage engine, then naturally, you can't load balance them (at least, not without using some kind of stickiness). What you need is centralized storage for sessions, e.g. using a database or memcache. See also PHP sessions in a load balancing cluster - how?

Categories : PHP

PHP curl_init load ballance multiple servers
If you're looking for a poor-man's load balancer, you'd enumerate your endpoints into an array, call shuffle() and array_pop() the lucky winner. <?php $endpoints = array( 'http://api1.myco.com', 'http://api2.myco.com' ); shuffle($endpoints); define('REST_SERVER', array_pop($endpoints)); // ... ?> I'd also suggest you vet each candidate to ensure it's "up"/"available" before issuing API calls, which is outside the context of this question.

Categories : PHP

getting Failed to load map. Error contacting Google servers
I tried to do almost everything like generating the key for 20 times, changing the order of the permissions, but there is nothing batter than just removing the project from workspace and importing it back again.

Categories : Android

Failed to load map. Error contacting Google servers on fragment
Your min sdk is 14. No need to use SupportMapFragment. Use MapFragment. https://developers.google.com/maps/documentation/android/reference/com/google/android/gms/maps/MapFragment. <fragment android:id="@+id/map" android:layout_width="match_parent" android:layout_height="fill_parent" android:name="com.google.android.gms.maps.MapFragment"/> ALso GoogleMap mMap = ((MapFragment) getFragmentManager().findFragmentById(R.id.map)) .getMap(); Also missing permissions <uses-permission android:name="android.permission.INTERNET"/> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/> <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/> <uses-permission android:

Categories : Android

windows 8, could not update application data due to xml cache in Javascript Application
I found the solution for the issue from http://msdn.microsoft.com/en-us/library/windows/apps/hh868281.aspx Adding the header param to the URL did the trick.

Categories : Javascript

Deploying application artifacts to web servers
I recommend looking at the Jenkins SCP plugin: https://wiki.jenkins-ci.org/display/JENKINS/SCP+plugin I haven't used it myself, but since you mentioned PowerShell, there is a Jenkins PowerShell plugin: https://wiki.jenkins-ci.org/display/JENKINS/PowerShell+Plugin The PublishOver plugin looks useful as well: https://wiki.jenkins-ci.org/display/JENKINS/Publish+Over Alternatively you can run any arbitrary shell command using Jenkins shell script build step.

Categories : C#

Failed to load map. Error contacting Google servers. This is probably an authentication issue
it sounds like you have problem with your API_KEY which is obtained from Google API Access ,so verify your API_KEY , certificate fingerprints and package name also use this inside <manifest> <uses-feature android:glEsVersion="0x00020000" android:required="true" > </uses-feature> and also verify: <meta-data .... > should be inside <application> tag PS. 1. Also try by adding following Permission <uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES"/> 2. After changing API key in AndroidManifest.xml Must Clear Application Data To Clear Application Data : Either Go to Settings>Application Manager>Select Your Application > Click on Clear Data Or Must Uninstall The Application

Categories : Android

Same diskstore for the same application deployed on different clustered servers
You cannot share EhCache diskstore between 2 server. You have to go with one of the ways to distrubute EhCache. You can try with RMI that does not require you to deploy another piece of software. It's documented here: http://ehcache.org/documentation/user-guide/rmi-replicated-caching. A more scalable way is to use Terracotta Server Array but it's not anymore supported by Terracotta. They are now pushing for BigMemory (that is free for up to 4 nodes). It's not hard to set up, it connects your EhCache so they will always be synchronized across all your servers. It's a great piece of software but support and documentation is scarce. Start from here: http://terracotta.org/documentation/4.0/bigmemorymax/configuration/configuration

Categories : Tomcat

Where is my nginx being configured? Changing nginx.conf still brings me to the 'Welcome to nginx' page
when you rewrited the nginx.conf in the folder of source code of nginx and installed it firstly, it will be copied to /usr/local/nginx/conf/nginx.conf (without specially modification of the configure in the folder of source code). But when you do this secondly, the nginx.conf in the folder of source code will be copied to /usr/local/nginx/conf/nginx.conf.defualt,and it usually don't work unless you use nginx -c /usr/local/nginx/conf/nginx.conf.defualt to assign its configure file evertime. There is a line NGINX_CONF_FILE="/usr/local/nginx/conf/nginx.conf" in your script above,which indicates the configure file clearly. To handle this, I suggest rewrite /usr/local/nginx/conf/nginx.conf (not the one in the folder of source code) instead.

Categories : Nginx

How does one setup two non-load-balanced VM web servers in Azure, capable of communicating on private ports?
A single cloud service is a security boundary and the only way into it is through a public (input) endpoint on the unique public VIP of the service. A Virtual Network (VNET) can be used to host multiple cloud services and allow private visibility among them without going through a public endpoint. A typical model would be to put an IIS website in a PaaS cloud service with a public VIP and the backend SQL Server in an IaaS cloud service with a public VIP but NO public endpoints declared on it. Both these cloud services would be hosted in the same VNET. This allows the front end web role instances access to the backend SQL Server instance over the private VNET. There is a hands-on lab in the Windows Azure Training Kit that describes precisely how to implement this. In this case I would rec

Categories : Azure

How can I get application libraries (jarNames) on java web servers like Tomcat and WAS?
There is no portable API to get this information. On WebSphere Application Server, ClassLoader.toString typically contains the full class path for diagnostic purposes, but I would definitely not recommend attempting to "parse" the output. I wouldn't recommend using reflection on Tomcat either: it might work for current Tomcat versions, but there's no guarantee the class loader implementation won't change and break your application.

Categories : Java



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.