O TTIMIZZARE LE CONFIGURAZIONI DI UN SERVER Burstnet Informatica 1.

44
OTTIMIZZARE LE CONFIGURAZIONI DI UN SERVER Burstnet Informatica 1

Transcript of O TTIMIZZARE LE CONFIGURAZIONI DI UN SERVER Burstnet Informatica 1.

Page 1: O TTIMIZZARE LE CONFIGURAZIONI DI UN SERVER Burstnet Informatica 1.

1

OTTIMIZZARE LE CONFIGURAZIONI DI UN

SERVER

Burstnet Informatica

Page 2: O TTIMIZZARE LE CONFIGURAZIONI DI UN SERVER Burstnet Informatica 1.

2

Burstn

et In

form

atica

OTTIMIZZARE LE CONFIGURAZIONI DI UN SERVER

Scopo del server. Ottimizzazione dei servizi più comuni:

File server DHCP DNS WINS FTP Web server Printer management Proxy

Page 3: O TTIMIZZARE LE CONFIGURAZIONI DI UN SERVER Burstnet Informatica 1.

3

Burstn

et In

form

atica

SCOPO DEL SERVER

Cosa dovrà fare il mio server? A quali parametri dare priorità?

Affidabilità Sicurezza Prestazioni

Come regola generale è sempre meglio eliminare il non necessario Minori vulnerabilità Maggiori prestazioni Minore difficoltà nella gestione

Page 4: O TTIMIZZARE LE CONFIGURAZIONI DI UN SERVER Burstnet Informatica 1.

4

Burstn

et In

form

atica

OTTIMIZZAZIONE DEI SERVIZI

Ottimizzare un servizio significa configurarlo in maniera affidabile, prestazionale(veloce) e sicura

In ogni sistema prima di cimentarsi nella configurazione di un servizio è bene documentarsi: Internet Help Man pages

Page 5: O TTIMIZZARE LE CONFIGURAZIONI DI UN SERVER Burstnet Informatica 1.

5

Burstn

et In

form

atica

OTTIMIZZARE UN FILE SERVER

A file server differs from a personal computer (PC) in that the server is dedicated to storing files in a centralized location while permitting access to networked computers.

By having a file server, users can save work and have access to files without having to carry around a disk. Access privileges can be restricted to guests and registered users. Meanwhile a centralized location means once place to backup all files.

Page 6: O TTIMIZZARE LE CONFIGURAZIONI DI UN SERVER Burstnet Informatica 1.

6

Burstn

et In

form

atica

OTTIMIZZARE UN FILE SERVER

Benefits: Files on the network server are backed up on

a regular basis. If you inadvertently deleted an important file, it can be retrieved from the back up tape. In addition, if you have a hard drive failure the files you saved on the network server will not be affected.

Page 7: O TTIMIZZARE LE CONFIGURAZIONI DI UN SERVER Burstnet Informatica 1.

7

Burstn

et In

form

atica

OTTIMIZZARE UN FILE SERVER

Benefits: Files can be shared with others. Several

people may be working on a document. Storing the file in a shared directory allows each person to directly work on the document as needed.

If you use several PCs in the course of your work, files on the server are available from any local PC. So you have access to the files whether you are at your personal office PC or using a coworker's PC.

Page 8: O TTIMIZZARE LE CONFIGURAZIONI DI UN SERVER Burstnet Informatica 1.

8

Burstn

et In

form

atica

OTTIMIZZARE UN FILE SERVER

Windows optimization:One way of improving the performance of your

server is to tweak the NTFS file system. In certain scenarios, simple changes can make a big difference; that's because hard disks are often a primary bottleneck in today's machines, which have fast processors and lots of memory.

Page 9: O TTIMIZZARE LE CONFIGURAZIONI DI UN SERVER Burstnet Informatica 1.

9

Burstn

et In

form

atica

OTTIMIZZARE UN FILE SERVERWindows optimization: Disable Short Filenames Name Your Files Appropriately Use More Folders Use More Partitions Plan Your Cluster Size Defragment Regularly Reserve Space for the MFT Disable Last Access Time Turn Off (or On) the Indexing Service Use FAT32 for the Paging File

Page 10: O TTIMIZZARE LE CONFIGURAZIONI DI UN SERVER Burstnet Informatica 1.

10

Burstn

et In

form

atica

OTTIMIZZARE UN FILE SERVER 1. Disable Short Filenames By default, NTFS creates an 8.3 filename every time it

creates a long filename, which adds a bit of time to the file creation process. To speed things up, you can disable short filenames using the fsutil

2. Name Your Files Appropriately Let's say you can't disable 8.3 filenames because of older

software on your machine. You can still improve NTFS performance by choosing a naming scheme for your files so that files located in the same folder differ at the start of their names instead of at the end. So for example, instead of NTFS Performance Hacks version 1.doc NTFS Performance Hacks version 2.doc and so on, you might name your files 1 NTFS Performance Hacks.doc - 2 NTFS Performance Hacks.doc and so on. That way NTFS won't have to work so hard to generate a unique 8.3 name for each file in the folder.

Page 11: O TTIMIZZARE LE CONFIGURAZIONI DI UN SERVER Burstnet Informatica 1.

11

Burstn

et In

form

atica

OTTIMIZZARE UN FILE SERVER 3. Use More Folders If you frequently need to open, close, create, or delete

certain types of files, keep the number of such files in each folder small. In other words, if you have a lot of these files, create additional folders to spread them out between folders. If this isn't practical for some reason, then the first two hacks above can help compensate for having too many files in one folder.

4. Use More Partitions In Windows 2000, when you partition a large disk (50GB

or more, say) into several smaller NTFS volumes (10GB each), you can speed disk performance by up to 10 percent. NTFS on Windows XP has been improved to perform better overall, but you can still squeeze a percent or two of better performance out of a large disk by partitioning it into several smaller volumes.

Page 12: O TTIMIZZARE LE CONFIGURAZIONI DI UN SERVER Burstnet Informatica 1.

12

Burstn

et In

form

atica

OTTIMIZZARE UN FILE SERVER 5. Plan Your Cluster Size The default cluster size on NTFS volumes is 4K, which

is fine if your files are typically small and generally remain the same size. But if your files are generally much larger or tend to grow over time as applications modify them, try increasing the cluster size on your drives to 16K or even 32K to compensate. That will reduce the amount of space you are wasting on your drives and will allow files to open slightly faster. Two caveats, though: If you want to compress older files to save disk space using NTFS compression, you have to leave the cluster size at 4K. The smaller your files (compared with the cluster size), the more fragmented your volume will tend to become over time. The second caveat means that you should also ...

Page 13: O TTIMIZZARE LE CONFIGURAZIONI DI UN SERVER Burstnet Informatica 1.

13

Burstn

et In

form

atica

OTTIMIZZARE UN FILE SERVER

6. Defragment Regularly Fragmented drives increase the time it takes for

applications to open, close, create, or delete files. A good practice is to use Windows XP's Disk Defragmenter tool to defrag your drive at least once a week, especially if you run applications that frequently modify files and you have a lot of files on your drives. If you like, you can use the Scheduled Task Wizard to automate this process. See How to Automate Disk Defragmenter Using Task Scheduler Tool in Windows XP in the Microsoft Knowledge Base for instructions.

Page 14: O TTIMIZZARE LE CONFIGURAZIONI DI UN SERVER Burstnet Informatica 1.

14

Burstn

et In

form

atica

OTTIMIZZARE UN FILE SERVER 7. Reserve Space for the MFT NTFS on Windows XP improves performance of the

Master File Table (MFT) over Windows 2000 by not placing some of the MFT metadata files at the start of the disk. This enhancement alone can boost NTFS performance on Windows XP by up to 10 percent over Windows 2000. But you can squeeze out even better performance by ensuring that your drive has enough room for the MTF to grow if it has to. This will prevent the MTF from becoming fragmented, which is important because the Disk Defragmenter tool can't defragment the MFT.

Page 15: O TTIMIZZARE LE CONFIGURAZIONI DI UN SERVER Burstnet Informatica 1.

15

Burstn

et In

form

atica

OTTIMIZZARE UN FILE SERVER 8. Disable Last Access Time By default, each file and folder on an NTFS volume

has an attribute called Last Access Time, which records the last time the file or folder was opened, read, or changed. This means even when you read a file on an NTFS volume, a write action occurs on that volume too. Normally this isn't a problem, but if you have an application that tends to frequently access files for short periods of time, this feature of NTFS can really slow performance. Fortunately, you can use fsutil to disable writing to the Last Access Time attribute: fsutil behavior set disablelastaccess 1 Once this is done, the Last Access Time attribute for newly created files will simply be their File Creation Time. One caveat: disabling Last Access Time may affect the operation of backup programs that use the Remote Storage service.

Page 16: O TTIMIZZARE LE CONFIGURAZIONI DI UN SERVER Burstnet Informatica 1.

16

Burstn

et In

form

atica

OTTIMIZZARE UN FILE SERVER

9. Turn Off (or On) the Indexing Service Whether you enable or disable the Indexing Service

on Windows XP depends on your needs. If you search for files on your hard drive only rarely, it's probably best to leave Indexing turned off, since it adds a slight overhead to NTFS operation and also uses up disk space to store the catalog. But if you search for files on your hard drive frequently (and need to search the contents of files as well) then turn Indexing on, as it will speed the search process considerably.

Page 17: O TTIMIZZARE LE CONFIGURAZIONI DI UN SERVER Burstnet Informatica 1.

17

Burstn

et In

form

atica

OTTIMIZZARE UN FILE SERVER

10. Use FAT32 for the Paging File Finally, if you have a second physical disk in your

machine, you can boost performance by moving your paging file (pagefile.sys) onto your second drive. To make this work best, do the following: Create a volume on your second drive, making sure the volume is big enough to hold your paging file. Format the new volume using FAT32 instead of NTFS, since FAT32 gives slightly better read performance on smaller volumes. Don't create any additional volumes on your second drive--that is, leave this drive for exclusive use by the paging file. So in other words, our final NTFS tweak is to not use NTFS for your paging volume

Page 18: O TTIMIZZARE LE CONFIGURAZIONI DI UN SERVER Burstnet Informatica 1.

18

Burstn

et In

form

atica

OTTIMIZZARE UN FILE SERVER

Optimizing Linux: System performance can be optimized not

only by selecting the most appropriate filesystem(s), but also by utilizing the various options that are available for most filesystems

 Set allocation block Journaling file systems Swap file:

Split the swap space across multiple drives Put each swap partition on the outer tracks

Page 19: O TTIMIZZARE LE CONFIGURAZIONI DI UN SERVER Burstnet Informatica 1.

19

Burstn

et In

form

atica

OTTIMIZZARE UN SERVER DHCP

The Dynamic Host Configuration Protocol (DHCP allows networks to automatically assign IP addresses to clients and set up various configuration parameters.

Many networks use DHCP to reduce client configuration when allocating IP addresses Wireless use

Lease time Upgrade Hardware on DHCP server

Hard disk ( better performance) Increase Ram

Page 20: O TTIMIZZARE LE CONFIGURAZIONI DI UN SERVER Burstnet Informatica 1.

20

Burstn

et In

form

atica

OTTIMIZZARE UN SERVER DNS

Domain Name System (spesso indicato con DNS) è un sistema utilizzato per la risoluzione di nomi di host in indirizzi IP e viceversa.

Page 21: O TTIMIZZARE LE CONFIGURAZIONI DI UN SERVER Burstnet Informatica 1.

21

Burstn

et In

form

atica

OTTIMIZZARE UN SERVER DNS

Il processo di ricerca DNS richiede al vostro server DNS locale un dominio, se la richiesta non è attendibile, si deve chiedere ad altri server per ottenere una risposta. Il server locale potrebbe essere molto impegnato nell'esecuzione di queste richieste di ricerca, e questo potrebbe rallentare le prestazioni.

Per combattere questo, le risposte che un server DNS riceve da un altro server DNS possono essere aggiunte alla propria banca dati interna e conservati per un periodo di tempo pari al tempo di vita (TTL).

Page 22: O TTIMIZZARE LE CONFIGURAZIONI DI UN SERVER Burstnet Informatica 1.

22

Burstn

et In

form

atica

OTTIMIZZARE UN SERVER DNS

Memorizzare tali risposte ( memoria cache) consente a un server DNS di rispondere più rapidamente alle query multiple per lo stesso dominio o host.

Se richiamate un sito già visitato il server DNS locale non deve cercare di nuovo l’host, a condizione che il relativo time to live (TTL) non sia scaduto e abbia causato la cancellazione delle informazioni.

Page 23: O TTIMIZZARE LE CONFIGURAZIONI DI UN SERVER Burstnet Informatica 1.

23

Burstn

et In

form

atica

OTTIMIZZARE UN SERVER DNS

Un DNS caching riduce il carico di un server DNS autorevole per gestire le richieste che non appartengono al dominio locale.

Se il TTL è alto ed è stato effettuato un cambio host il sito richiesto potrebbe impiegare ore/giorni prima di essere nuovamente raggiungibile

Page 24: O TTIMIZZARE LE CONFIGURAZIONI DI UN SERVER Burstnet Informatica 1.

24

Burstn

et In

form

atica

AGGIUNTA DI UN SERVER WINS

I server WINS (Windows Internet Name Service) eseguono il mapping dinamico tra indirizzi IP e nomi di computer (nomi NetBIOS).

Gli utenti possono accedere alle risorse specificando il nome di computer anziché l'indirizzo IP.

Se si desidera utilizzare il computer per tenere traccia dei nomi e degli indirizzi IP di altri computer della rete, configurarlo come server WINS.

Page 25: O TTIMIZZARE LE CONFIGURAZIONI DI UN SERVER Burstnet Informatica 1.

25

Burstn

et In

form

atica

AGGIUNTA DI UN SERVER WINS

WINS vs DNS While WINS resolves names in the NetBIOS

namespace, DNS resolves names in the DNS domain namespace.

WINS isn't necessary for all communication. NetBIOS has been designed around a "broadcast" mechanism. The default Windows behavior is to simply

broadcast information on the local network. Installing a WINS server (and configuring the

clients to use it) will reduce broadcast traffic. 

Page 26: O TTIMIZZARE LE CONFIGURAZIONI DI UN SERVER Burstnet Informatica 1.

26

Burstn

et In

form

atica

OTTIMIZZARE UN SERVER FTP

Il File Transfer Protocol (FTP) (protocollo di trasferimento file) è un Protocollo per la trasmissione di dati tra host basato su TCP.

FTP è utile per: Promuovere la condivisione di file (programmi o

dati) Incoraggiare l'uso indiretto o implicito di

computer remoti. Risolvere in maniera trasparente incompatibilità

tra differenti sistemi di stoccaggio file tra host. Trasferire dati in maniera affidabile ed efficiente.

Page 27: O TTIMIZZARE LE CONFIGURAZIONI DI UN SERVER Burstnet Informatica 1.

27

Burstn

et In

form

atica

OTTIMIZZARE UN SERVER FTP

FTP:Attivo

Il cliente sceglie la porta di comunicazione

PassivoIl server sceglie la porta di comunicazione

 In genere la scelta di un FTP attivo o FTP passivo è fatta per problematiche legate ai firewall. 

Page 28: O TTIMIZZARE LE CONFIGURAZIONI DI UN SERVER Burstnet Informatica 1.

28

Burstn

et In

form

atica

OTTIMIZZARE UN SERVER FTP

Quando non richiesto è bene disabilitare l’accesso anonimo: Sovente abilitato di default. Problemi di sicurezza. Saturazione delle risorse.

L'SSH File Transfer Protocol o SFTP è un protocollo di rete che prevede il trasferimento dei dati e funzionalità di manipolazione. È tipicamente usato con il protocollo SSH-2 che utilizza un trasferimento dei file sicuro, anche se è utilizzabile con un qualsiasi altro protocollo.

Page 29: O TTIMIZZARE LE CONFIGURAZIONI DI UN SERVER Burstnet Informatica 1.

29

Burstn

et In

form

atica

OTTIMIZZARE UN SERVER FTP

Il protocollo SFTP non è ancora diventato standard. Sono però documentate le specifiche riguardo all'ultima versione del protocollo, la 6. La versione più usata, però, è la 3, che è implementata nel popolare OpenSSH come server SFTP.

OpenSSH (Open Secure Shell) è un insieme di programmi che rendono disponibili sessioni crittografate di comunicazione in una rete di computer usando il protocollo SSH.

Page 30: O TTIMIZZARE LE CONFIGURAZIONI DI UN SERVER Burstnet Informatica 1.

30

Burstn

et In

form

atica

OTTIMIZZARE UN WEB SERVER

Page 31: O TTIMIZZARE LE CONFIGURAZIONI DI UN SERVER Burstnet Informatica 1.

31

Burstn

et In

form

atica

OTTIMIZZARE UN WEB SERVER

A Web server is a computer program that delivers (serves) content, such as Web pages, using the Hypertext Transfer Protocol (HTTP), over the World Wide Web.

The term Web server can also refer to the computer or virtual machine running the program

Page 32: O TTIMIZZARE LE CONFIGURAZIONI DI UN SERVER Burstnet Informatica 1.

32

Burstn

et In

form

atica

WEB SERVER

Data Compression Save bandwidth up to 80%

Expires headers – Caching  how long the object is fresh for; after that time,

caches will always check back with the origin server to see if a document is changed

The If-Modified-Since request header The purpose of this feature is to allow efficient

updates of cached information with a minimum of transaction overhead.

Page 33: O TTIMIZZARE LE CONFIGURAZIONI DI UN SERVER Burstnet Informatica 1.

33

Burstn

et In

form

atica

OTTIMIZZARE UN WEB SERVER

Picture type and quality Save images no higher than 72 dpi Choose the right format for the image

Reduce the amount of connections the client makes Every object you have on your page will require at

least one request thread from the client. If you have 3 pics, the main HTML page and a css file then you are serving out 5 objects and the client will try to make 5 connections to you. If you reduce the amount of objects on your page the client will load faster and not make as many requests to the server.

Page 34: O TTIMIZZARE LE CONFIGURAZIONI DI UN SERVER Burstnet Informatica 1.

34

Burstn

et In

form

atica

OTTIMIZZARE UN WEB SERVER

Use KeepAlives, but not for too long (5 second timeout) Keepalives are a persistent connection between

a client browser and a server Enable pipelining on the server and the

clients HTTP pipelining is a technique in which multiple

HTTP requests are written out to a single socket without waiting for the corresponding responses.

Page 35: O TTIMIZZARE LE CONFIGURAZIONI DI UN SERVER Burstnet Informatica 1.

35

Burstn

et In

form

atica

OTTIMIZZARE UN WEB SERVER Watch the bots

Bots can make a big impact on the amount of data your server sends out. Use the robots.txt file you disallow pages or directories you do not want indexed.

Submit a Sitemap instead of just letting the search engine find the

pages itself

Page 36: O TTIMIZZARE LE CONFIGURAZIONI DI UN SERVER Burstnet Informatica 1.

36

Burstn

et In

form

atica

OTTIMIZZARE UN WEB SERVER

… configurare un web server non è un’operazione semplice Molti parametri da considerare Interessi economici dei Vostri clienti E’ richiesta:

Accurata conoscenza delle reti Conoscenza di HTML e di altri linguaggi di

programmazione per il web (PHP, JAVASCRIPT, ecc.) Competenze in materia di sicurezza informatica Conoscenza delle più comuni piattaforme:

Apache IIS

Queste slide vi dovranno servire solo come spunto per successivi approfondimenti …

Page 37: O TTIMIZZARE LE CONFIGURAZIONI DI UN SERVER Burstnet Informatica 1.

37

Burstn

et In

form

atica

PRINTER MANAGEMENT

Il printer management è qualcosa di più che il semplice invio di task a una coda di stampa.

Il printer management comporta anche la configurazione, la ricerca e le soluzioni ai problemi di stampa, non ultimo dei quali i rapporti con gli utenti “capricciosi” che usano in modo inadeguato la stampante.

Un problema che gli amministratori di rete si trovano costantemente a fronteggiare è la congestione dei flussi del network cui si assiste quando diversi utenti tentano di stampare tutti nello stesso momento

Page 38: O TTIMIZZARE LE CONFIGURAZIONI DI UN SERVER Burstnet Informatica 1.

38

Burstn

et In

form

atica

PRINTER MANAGEMENT

 Le code di stampa si sovraccaricano e presto arriva la congestione della stampante.

Un modo per ovviare a tutto questo è la creazione di un pool di stampanti, ovvero un gruppo di macchine collegate a una coda di stampa comune, in modo che più documenti possano essere stampati simultaneamente. 

Stampe non necessarie  priorità per la coda di stampa in modo da

bloccare coloro che tendono a immobilizzare inutilmente le risorse di rete.

Page 39: O TTIMIZZARE LE CONFIGURAZIONI DI UN SERVER Burstnet Informatica 1.

39

Burstn

et In

form

atica

PRINTER MANAGEMENT

Le stampanti condivise Molti amministratori Windows utilizzano Active

Directory per creare e gestire le stampanti di rete. Si tratta di una grande risorsa per chi sa come usarla. Per esempio, Active Directory può essere utile quando alcuni utenti hanno la necessità di accedere a una stampante che in genere non usano. Un amministratore può creare un elenco di Active Directory, che indirizza gli utenti a una coda di stampa ospitata su un server Windows attraverso il quale può passare un determinato lavoro.

Page 40: O TTIMIZZARE LE CONFIGURAZIONI DI UN SERVER Burstnet Informatica 1.

40

Burstn

et In

form

atica

PRINTER MANAGEMENT

Stampanti condivise: Se da una parte la stampa attraverso la coda può

non essere efficiente come l'invio diretto da una postazione di lavoro alla stampante di rete, dall'altra parte permette di ridurre le chiamate agli help desk poiché gli utenti possono utilizzare Active Directory per individuare tale stampante.

Page 41: O TTIMIZZARE LE CONFIGURAZIONI DI UN SERVER Burstnet Informatica 1.

41

Burstn

et In

form

atica

OTTIMIZZARE UN PROXY

Il Proxy Web server per ottimizzare l’accesso a Internet: in caso di frequenti accessi alle medesime pagine, il server ne memorizza una copia locale da restituire ai client della rete, evitando così di doverle reperire direttamente su Internet.

Alcuni proxy sono dotati anche di funzionalità di content restriction, ovvero possono essere configurati per impedire o permettere il reperimento delle diverse risorse sulla base dell'Url o dei contenuti.  No facebook durante l’orario di lavoro ….

Page 42: O TTIMIZZARE LE CONFIGURAZIONI DI UN SERVER Burstnet Informatica 1.

42

Burstn

et In

form

atica

OTTIMIZZARE UN PROXY

Le soluzioni di Content Filtering aiutano l'azienda ad utilizzare in maniera produttiva l'accesso a Internet, monitorando e gestendo il traffico generato dai propri collaboratori.

Questi prodotti permettono, infatti, di filtrare indirizzi che possono rilevarsi improduttivi per l'attività aziendale. Attraverso il database raggruppato per categorie e costantemente aggiornato, permettono di discriminare la visibilità o la non visibilità di siti internet.

Page 43: O TTIMIZZARE LE CONFIGURAZIONI DI UN SERVER Burstnet Informatica 1.

43

Burstn

et In

form

atica

OTTIMIZZARE UN PROXY

Esistono vari tipi di proxy. Qui di seguito verranno descritti i principali: WinGate, un proxy server utilizzato per reindirizzare

ogni tipo di traffico su un box Windows. Non è semplice da configurare I settaggi predefiniti non forniscono una sufficiente

protezione del computer. Microsoft Proxy, creato per server proxy commerciali,

ma anche utilizzato in ambito domestico. L'attivazione è semplice, ma necessita di certi requisiti.

Microsoft's ISA Server, che funziona su box con Windows 2000/2003 /2008 server, combina le funzioni sia di un server proxy che di un firewall.

Squid, server cache/proxy per UNIX, utilizzato per reindirizzare, in genere, il traffico HTTP. 

Page 44: O TTIMIZZARE LE CONFIGURAZIONI DI UN SERVER Burstnet Informatica 1.

44

Burstn

et In

form

atica

OTTIMIZZARE UN PROXY

Un proxy per essere ottimizzato necessità di:Dischi velociFile system adeguatoPolitiche di caching adeguateGli altri parametri dipendono “fortemente”

dal software che avete sceltoNb non installate mai un software per sentito dire

In ambito open source una buona scelta è l’accoppiata Squid e SquidGuard