zfs tuning

zfs tuning:-
---------------

#!/usr/bin/env bash

echo "42949672960" >> /sys/module/zfs/parameters/zfs_arc_max
echo "32212254720" >> /sys/module/zfs/parameters/zfs_arc_min
echo "10737418240" >> /sys/module/zfs/parameters/zfs_dirty_data_max
echo "12" >> /sys/module/zfs/parameters/zfs_vdev_async_read_max_active
echo "8" >> /sys/module/zfs/parameters/zfs_vdev_async_read_min_active
echo "12" >> /sys/module/zfs/parameters/zfs_vdev_async_write_max_active
echo "8" >>/sys/module/zfs/parameters/zfs_vdev_async_write_min_active
echo "12" >> /sys/module/zfs/parameters/zfs_vdev_sync_read_max_active
echo 12 >>/sys/module/zfs/parameters/zfs_vdev_sync_write_max_active
echo 8 >>/sys/module/zfs/parameters/zfs_vdev_sync_write_min_active
echo 8 >> /sys/module/zfs/parameters/zfs_vdev_sync_read_min_active
echo 1 > /sys/module/zfs/parameters/zfs_prefetch_disable
echo "131072" >>/sys/module/zfs/parameters/zfs_vdev_write_gap_limit
 


cat zfs_prefetch_disable
 echo 1 > zfs_prefetch_disable
  zfs get recordsize data_pool
  zfs get recordsize data_pool/storage
  zpool status data_pool
grep gap
echo "131072" >>zfs_vdev_write_gap_limit
 zfs get sync data_pool/storage
 zfs set sync=disabled data_pool/storage

1_recommender_system_popularity_based

Data source: cuisine.csv kaggle
#ratings 2=best 1=medium 0=worst
import pandas as pd
import numpy as np
initialFrame=pd.read_csv('/Users/ezer/Downloads/RCdata/rating_final.csv')
cuisine=pd.read_csv('/Users/ezer/Downloads/RCdata/chefmozcuisine.csv')
#select restaurant with rating 2 gives boolean true false
top_rated_restaurant=initialFrame['rating']==2
#now create dataframe with rating2
frame=initialFrame[top_rated_restaurant]
# print(top_rated_restaurant.head())


result1=pd.DataFrame(frame.groupby('placeID')['rating'].count().sort_values(ascending=False))
# display 10 top rated popular restaurants
pd.DataFrame(frame.groupby('placeID')['rating'].count().sort_values(ascending=False)).head(10)

rating
placeID
135085 18
132825 15
135052 14
 ## creating dataframe of placeID
#pd.DataFrame([135085,132825,135052..],index=np.arange(5),columns=['placeID'])
#above is too manual so lets get index value only from above df
dfindexarray=result1.index
print(dfindexarray)

Int64Index([135085, 132825, 135052, 135032, 135025, 135038, 135075, 132862,
            135062, 135042,

LenOfDf=len(dfindexarray)
most_rated_places=pd.DataFrame(dfindexarray,index=np.arange(LenOfDf),columns=['placeID'])
print(most_rated_places)

summary=pd.merge(most_rated_places,cuisine,on='placeID')
# print(summary)
# get most common cuisine in top restaurants
# summary['Rcuisine'].describe()
# get cuisines from restaurant with id 135052
summary[summary['placeID']==135052]


placeID Rcuisine
2 135052 Bar
3 135052 Bar_Pub_Brewery

# Recommender system says that most popular rated Place serves Mexican food


matplotlib basics 2

 import matplotlib.pyplot as plt
%matplotlib inline
import numpy as np
x=np.linspace(0,5,11)
y=x**2

fig=plt.figure()
ax=fig.add_axes([0,0,1,1])
ax.plot(x,y)
ax.set_title('Title')

fig=plt.figure()
ax=fig.add_axes([0,0,1,1])
ax.plot(x,y,color='#FF8c00',linewidth=1,alpha=0.5,linestyle='--',marker='o',markersize=5) #rgb hex code and alha is transparency

matplotlib basics 1

import matplotlib.pyplot as plt
%matplotlib inline
plt.plot([3,7,8],[5,2,9],label="FirstLine")
plt.plot([2,5,7],[3,5,1],label="Second Line")
plt.xlabel('X-label sample')
plt.ylabel('Y-label sample')
plt.title('Interesting Graph\nCheckit out')
plt.legend()
plt.show()