I am using starcluster with Ipython plugin . When I run a Kmeans clustering from Ipython notebook with load balance mode. Its always the Master with 100% CPU usage constantly. And the other EC2 instances never takes the load.
I tried with large datasets and 20 nodes . The result is same all the Load is on the Master. I tried direct view with the node001 but even then the master is having all the load.
Am I configuring any thing wrong. Do I need to make the Disable Queue true in the config? How can I distribute the load on all the Instances.
Template file
[cluster iptemplate]
KEYNAME = ********
CLUSTER_SIZE = 2
CLUSTER_USER = ipuser
CLUSTER_SHELL = bash
REGION = us-west-2
NODE_IMAGE_ID = ami-04bedf34
NODE_INSTANCE_TYPE = m3.medium
#DISABLE_QUEUE = True
PLUGINS = pypackages,ipcluster
[plugin ipcluster]
SETUP_CLASS = starcluster.plugins.ipcluster.IPCluster
ENABLE_NOTEBOOK = True
NOTEBOOK_PASSWD = *****
[plugin ipclusterstop]
SETUP_CLASS = starcluster.plugins.ipcluster.IPClusterStop
[plugin ipclusterrestart]
SETUP_CLASS = starcluster.plugins.ipcluster.IPClusterRestartEngines
[plugin pypackages]
setup_class = starcluster.plugins.pypkginstaller.PyPkgInstaller
packages = scikit-learn, psutil, scikit-image, numpy, pyzmq
[plugin opencvinstaller]
setup_class = ubuntu.PackageInstaller
pkg_to_install = cmake
[plugin pkginstaller]
SETUP_CLASS = starcluster.plugins.pkginstaller.PackageInstaller
# list of apt-get installable packages
PACKAGES = python-mysqldb
Code
from IPython import parallel
clients = parallel.Client()
rc = clients.load_balanced_view()
def clustering(X_digits):
from sklearn.cluster import KMeans
kmeans = KMeans(20)
mu_digits = kmeans.fit(X_digits).cluster_centers_
return mu_digits
rc.block = True
rc.apply(clustering, X_digits)