C MySQL读写分离连接串_Mysql读写分离

一 什么是读写分离

MySQL Proxy最强大的一项功能是实现“读写分离(Read/Write Splitting)”。

基本的原理是让主数据库处理事务性查询,而从数据库处理SELECT查询。数据库复制被用来把事务性查询导致的变更同步到集群中的从数据库。

当然,主服务器也可以提供查询服务。使用读写分离最大的作用无非是缓解服务器压力。可以看下这张图:

51428634

7263e2fa044bf0c83b453067406fbfb4.png

二 读写分离的好处

1.增加冗余

2.增加了机器的处理能力

3.对于读操作为主的应用,使用读写分离是最好的场景,因为可以确保写的服务器压力更小,而读又可以接受点时间上的延迟。

三 读写分离提高性能之原因

1.物理服务器增加,负荷增加

2.主从只负责各自的写和读,极大程度的缓解X锁和S锁争用

3.从库可配置myisam引擎,提升查询性能以及节约系统开销

4.从库同步主库的数据和主库直接写还是有区别的,通过主库发送来的binlog恢复数据,但是,最重要区别在于主库向从库发送binlog是异步的,从库恢复数据也是异步的

5.读写分离适用与读远大于写的场景,如果只有一台服务器,当select很多时,update和delete会被这些select访问中的数据堵塞,等待select结束,并发性能不高。

对于写和读比例相近的应用,应该部署双主相互复制

6.可以在从库启动是增加一些参数来提高其读的性能,例如--skip-innodb、--skip-bdb、--low-priority-updates以及--delay-key-write=ALL。

当然这些设置也是需要根据具体业务需求来定得,不一定能用上

7.分摊读取。

假如我们有1主3从,不考虑上述1中提到的从库单方面设置,假设现在1分钟内有10条写入,150条读取。

那么,1主3从相当于共计40条写入,而读取总数没变,因此平均下来每台服务器承担了10条写入和50条读取(主库不承担读取操作)。

因此,虽然写入没变,但是读取大大分摊了,提高了系统性能。

另外,当读取被分摊后,又间接提高了写入的性能。所以,总体性能提高了,说白了就是拿机器和带宽换性能。

MySQL官方文档中有相关演算公式:官方文档 见6.9FAQ之“MySQL复制能够何时和多大程度提高系统性能”

8.MySQL复制另外一大功能是增加冗余,提高可用性,当一台数据库服务器宕机后能通过调整另外一台从库来以最快的速度恢复服务,

因此不能光看性能,也就是说1主1从也是可以的。

四 读写分离示意图

cd8c640e265646e73fa43b7a0a335a20.png

51428634

51428634

五 读写分离模拟

实验环境简介

serv01:代理服务器 192.168.1.11 serv01.host.com

serv08:主服务器(主要写数据,可读可写) 192.168.1.18 serv08.host.com

serv09:从服务器(主要读数据) 192.168.1.19 serv09.host.com

操作系统版本

RHEL Server6.1 64位系统

使用到的软件包版本

mysql-5.5.29-linux2.6-x86_64.tar.gz

mysql-proxy-0.8.2-linux-glibc2.3-x86-64bit.tar.gz

第一步,搭建MySQL服务器,清空日志。注意:代理服务器中不需要装MySQL

第二步,拷贝mysql-proxy-0.8.2-linux-glibc2.3-x86-64bit.tar.gz文件,解压文件

[root@larrywen 1005]# scp mysql-proxy-0.8.2-linux-glibc2.3-x86-64bit.tar.gz 192.168.1.11:/opt

[root@serv01 opt]# tar -xvf mysql-proxy-0.8.2-linux-glibc2.3-x86-64bit.tar.gz -C /usr/local/

[root@serv01 opt]# cd /usr/local/

[root@serv01 local]# mv mysql-proxy-0.8.2-linux-glibc2.3-x86-64bit/ mysql-proxy

[root@serv01 local]# ll mysql-proxy/

total 24

drwxr-xr-x. 2 7157 wheel 4096 Aug 17 2011 bin

drwxr-xr-x. 2 7157 wheel 4096 Aug 17 2011 include

drwxr-xr-x. 4 7157 wheel 4096 Aug 17 2011 lib

drwxr-xr-x. 2 7157 wheel 4096 Aug 17 2011 libexec

drwxr-xr-x. 3 7157 wheel 4096 Aug 17 2011 licenses

drwxr-xr-x. 3 7157 wheel 4096 Aug 17 2011 share

--可以查看帮助

[root@serv01 bin]# ./mysql-proxy --help-all

第三步,serv08主服务器创建用户,serv09从服务器创建用户,注意用户名和密码一致

serv08

mysql> grant all on *.* to 'larry'@'192.168.1.%' identified by 'larry';

Query OK, 0 rows affected (0.00 sec)

serv09

mysql> grant all on *.* to 'larry'@'192.168.1.%' identified by 'larry';

Query OK, 0 rows affected (0.00 sec)

第四步,serv09从服务器更改设置,开启slave,查看slave状态。创建测试数据库,插入测试数据

serv09

mysql> change master to master_host='192.168.1.18', master_user='larry', master_password='larry', master_port=3306, master_log_file='mysql-bin.000001', master_log_pos=107;

Query OK, 0 rows affected (0.01 sec)

mysql> start slave;

Query OK, 0 rows affected (0.00 sec)

mysql> show slave status \G;

*************************** 1. row ***************************

Slave_IO_State: Waiting for master to send event

Master_Host: 192.168.1.18

Master_User: larry

Master_Port: 3306

Connect_Retry: 60

Master_Log_File: mysql-bin.000001

Read_Master_Log_Pos: 107

Relay_Log_File: serv09-relay-bin.000002

Relay_Log_Pos: 253

Relay_Master_Log_File: mysql-bin.000001

Slave_IO_Running: Yes

Slave_SQL_Running: Yes

Replicate_Do_DB:

Replicate_Ignore_DB:

Replicate_Do_Table:

Replicate_Ignore_Table:

Replicate_Wild_Do_Table:

Replicate_Wild_Ignore_Table:

Last_Errno: 0

Last_Error:

Skip_Counter: 0

Exec_Master_Log_Pos: 107

Relay_Log_Space: 410

Until_Condition: None

Until_Log_File:

Until_Log_Pos: 0

Master_SSL_Allowed: No

Master_SSL_CA_File:

Master_SSL_CA_Path:

Master_SSL_Cert:

Master_SSL_Cipher:

Master_SSL_Key:

Seconds_Behind_Master: 0

Master_SSL_Verify_Server_Cert: No

Last_IO_Errno: 0

Last_IO_Error:

Last_SQL_Errno: 0

Last_SQL_Error:

Replicate_Ignore_Server_Ids:

Master_Server_Id: 2

1 row in set (0.00 sec)

ERROR:

No query specified

mysql> select user,password,host from mysql.user;

+------+-------------------------------------------+-----------------+

| user | password | host |

+------+-------------------------------------------+-----------------+

| root | | localhost |

| root | | serv08.host.com |

| root | | 127.0.0.1 |

| root | | ::1 |

| | | localhost |

| | | serv08.host.com |

| rep | *0CDC8D34246E22649D647DB04E7CCCACAB4368B6 | 192.168.1.% |

+------+-------------------------------------------+-----------------+

7 rows in set (0.00 sec)

mysql> create database larrydb;

Query OK, 1 row affected (0.00 sec)

mysql> use larrydb;

Database changed

mysql> create table user(id int, name varchar(30));

Query OK, 0 rows affected (0.01 sec)

mysql> insert into user values(1,'larrywen');

Query OK, 1 row affected (0.01 sec)

mysql> insert into user values(2,'wentasy');

Query OK, 1 row affected (0.00 sec)

mysql> select * from user;

+------+----------+

| id | name |

+------+----------+

| 1 | larrywen |

| 2 | wentasy |

+------+----------+

2 rows in set (0.00 sec)

serv09

mysql> select * from larrydb.user;

+------+----------+

| id | name |

+------+----------+

| 1 | larrywen |

| 2 | wentasy |

+------+----------+

2 rows in set (0.00 sec)

第五步,为了查看现象,serv09从服务器关闭slave

mysql> stop slave;

Query OK, 0 rows affected (0.01 sec)

第六步,serv 01查看是否有MySQL用户,修改rw-splitting.lua文件,修改如下几个参数

[root@serv01 mysql-proxy]# id mysql

uid=500(mysql) gid=500(mysql) groups=500(mysql)

[root@serv01 mysql-proxy]# vim rw-splitting.lua

[root@serv01 mysql-proxy]# cat rw-splitting.lua | grep -e min_idle_connections -e max_idle_connections -e is_debug

min_idle_connections = 1,--最小空闲连接数,为了测试,这里设置为1

max_idle_connections = 1,--最大空闲连接数,为了测试,这里设置为1

is_debug = true--是否打开Debug调试,为了查看调试信息,这里设置为true

第七步,启动mysql-proxy

[root@serv01 mysql-proxy]# /etc/init.d/mysql-proxy start

Starting mysql-proxy:

--先确定是否可以连接

[root@serv01 ~]# mysql -ularry -plarry -h 192.168.1.18

Welcome to the MySQL monitor. Commands end with ; or \g.

Your MySQL connection id is 6

Server version: 5.5.29-log Source distribution

Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its

affiliates. Other names may be trademarks of their respective

owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> exit

Bye

[root@serv01 ~]# mysql -ularry -plarry -h 192.168.1.19

Welcome to the MySQL monitor. Commands end with ; or \g.

Your MySQL connection id is 8

Server version: 5.5.29-log Source distribution

Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its

affiliates. Other names may be trademarks of their respective

owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> exit

Bye

第八步,查看现象

[root@serv01 ~]# /etc/init.d/mysql-proxy start

Starting mysql-proxy:

[root@serv01 ~]# mysql -ularry -plarry -h 192.168.1.11

[connect_server] 192.168.1.11:51054

[1].connected_clients = 0

[1].pool.cur_idle = 0

[1].pool.max_idle = 1

[1].pool.min_idle = 1

[1].type = 1

[1].state = 0

[1] idle-conns below min-idle

Welcome to the MySQL monitor. Commands end with ; or \g.

[read_query] 192.168.1.11:51054

current backend = 0

client default db =

client username = larry

query = select @@version_comment limit 1

sending to backend : 192.168.1.19:3306

is_slave : false

server default db:

server username : larry

in_trans : false

in_calc_found : false

COM_QUERY : true

Your MySQL connection id is 10

Server version: 5.5.29-log Source distribution

Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its

affiliates. Other names may be trademarks of their respective

owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql>

mysql> use larrydb;

[read_query] 192.168.1.11:51054

current backend = 0

client default db =

client username = larry

query = SELECT DATABASE()

sending to backend : 192.168.1.19:3306

is_slave : false

server default db:

server username : larry

in_trans : false

in_calc_found : false

COM_QUERY : true

[read_query] 192.168.1.11:51054

current backend = 0

client default db =

client username = larry

sending to backend : 192.168.1.19:3306

is_slave : false

server default db:

server username : larry

in_trans : false

in_calc_found : false

COM_QUERY : false

Database changed

mysql> select * from user;

[read_query] 192.168.1.11:51054

current backend = 0

client default db = larrydb

client username = larry

query = select * from user

sending to backend : 192.168.1.19:3306

is_slave : false

server default db: larrydb

server username : larry

in_trans : false

in_calc_found : false

COM_QUERY : true

+------+----------+

| id | name |

+------+----------+

| 1 | larrywen |

| 2 | wentasy |

+------+----------+

2 rows in set (0.00 sec)

mysql> insert into user values(3,'jsutdb');

[read_query] 192.168.1.11:51644

current backend = 0

client default db = larrydb

client username = larry

query = insert into user values(3,'jsutdb')

sending to backend : 192.168.1.19:3306

is_slave : false

server default db: larrydb

server username : larry

in_trans : false

in_calc_found : false

COM_QUERY : true

Query OK, 1 row affected (0.00 sec)

serv08

mysql> select * from user;

+------+----------+

| id | name |

+------+----------+

| 1 | larrywen |

| 2 | wentasy |

+------+----------+

2 rows in set (0.00 sec)

serv09

mysql> select * from larrydb.user;

+------+----------+

| id | name |

+------+----------+

| 1 | larrywen |

| 2 | wentasy |

| 3 | jsutdb |

+------+----------+

3 rows in set (0.00 sec)

第九步,以上的测试虽有效果,但不是预期。排查原因,重新配置。发现proxy-read-only-backend-addresses和proxy-backend-addresses参数配置出错,proxy-read-only-backend-addresses应该配置成从服务器的IP地址,proxy-backend-addresses应该配置成主服务器的IP地址。

[root@serv01 ~]# vim /etc/init.d/mysql-proxy

[root@serv01 ~]# cat /etc/init.d/mysql-proxy

#!/bin/sh

#

# mysql-proxy This script starts and stops the mysql-proxy daemon

#

# chkconfig: - 78 30

# processname: mysql-proxy

# description: mysql-proxy is a proxy daemon to mysql

# Source function library.

. /etc/rc.d/init.d/functions

#PROXY_PATH=/usr/local/bin

PROXY_PATH=/usr/local/mysql-proxy/bin

prog="mysql-proxy"

# Source networking configuration.

. /etc/sysconfig/network

# Check that networking is up.

[ ${NETWORKING} = "no" ] && exit 0

# Set default mysql-proxy configuration.

#PROXY_OPTIONS="--daemon"

PROXY_OPTIONS="--proxy-read-only-backend-addresses=192.168.1.19:3306 --proxy-backend-addresses=192.168.1.18:3306 --proxy-lua-script=/usr/local/mysql-proxy/share/doc/mysql-proxy/rw-splitting.lua"

#PROXY_PID=/usr/local/mysql-proxy/run/mysql-proxy.pid

PROXY_PID=/var/run/mysql-proxy.pid

# Source mysql-proxy configuration.

if [ -f /etc/sysconfig/mysql-proxy ]; then

. /etc/sysconfig/mysql-proxy

fi

PATH=$PATH:/usr/bin:/usr/local/bin:$PROXY_PATH

# By default it's all good

RETVAL=0

# See how we were called.

case "$1" in

start)

# Start daemon.

echo -n $"Starting $prog: "

$NICELEVEL $PROXY_PATH/mysql-proxy $PROXY_OPTIONS --daemon --pid-file=$PROXY_PID --user=mysql --log-level=debug --log-file=/var/log/mysql-proxy.log --proxy-address=192.168.1.11:3306

RETVAL=$?

echo

if [ $RETVAL = 0 ]; then

touch /var/lock/subsys/mysql-proxy

fi

;;

stop)

# Stop daemons.

echo -n $"Stopping $prog: "

killproc $prog

RETVAL=$?

echo

if [ $RETVAL = 0 ]; then

rm -f /var/lock/subsys/mysql-proxy

rm -f $PROXY_PID

fi

;;

restart)

$0 stop

sleep 3

$0 start

;;

condrestart)

[ -e /var/lock/subsys/mysql-proxy ] && $0 restart

;;

status)

status mysql-proxy

RETVAL=$?

;;

*)

echo "Usage: $0 {start|stop|restart|status|condrestart}"

RETVAL=1

;;

esac

exit $RETVAL

第十步,测试。插入数据,可以发现连接的是主服务器,查询的时候也是主服务器。说明主服务器和从服务器均有读的的功能。

[root@serv01 ~]# mysql -ularry -plarry -h 192.168.1.11

[connect_server] 192.168.1.11:57891

[1].connected_clients = 0

[1].pool.cur_idle = 0

[1].pool.max_idle = 1

[1].pool.min_idle = 1

[1].type = 1

[1].state = 1

[1] idle-conns below min-idle

[read_query] 192.168.1.11:57891

current backend = 0

client default db =

client username = larry

query = select @@version_comment limit 1

sending to backend : 192.168.1.18:3306

is_slave : false

server default db:

server username : larry

in_trans : false

in_calc_found : false

COM_QUERY : true

mysql> insert into user values(5,'test');

Query OK, 1 row affected (0.01 sec)

[read_query] 192.168.1.11:57893

current backend = 0

client default db = larrydb

client username = larry

query = insert into user values(5,'test')

sending to backend : 192.168.1.18:3306

is_slave : false

server default db: larrydb

server username : larry

in_trans : false

in_calc_found : false

COM_QUERY : true

mysql> select * from user;

+------+----------+

| id | name |

+------+----------+

| 1 | larrywen |

| 2 | wentasy |

| 5 | test |

+------+----------+

3 rows in set (0.00 sec)

[read_query] 192.168.1.11:57893

current backend = 0

client default db = larrydb

client username = larry

query = select * from user

sending to backend : 192.168.1.18:3306

is_slave : false

server default db: larrydb

server username : larry

in_trans : false

in_calc_found : false

COM_QUERY : true

serv08主服务器查看数据,可以查询到,说明主服务器可以写

mysql> select * from larrydb.user;

+------+----------+

| id | name |

+------+----------+

| 1 | larrywen |

| 2 | wentasy |

| 5 | test |

+------+----------+

3 rows in set (0.00 sec)

serv09从服务器查询数据,发现不可查询到,说明从服务器只读

mysql> mysql> select * from larrydb.user;

+------+----------+

| id | name |

+------+----------+

| 1 | larrywen |

| 2 | wentasy |

| 3 | jsutdb |

| 4 | db |

+------+----------+

4 rows in set (0.00 sec)

第十一步,开启slave。发现数据同步成功。

mysql> start slave;

Query OK, 0 rows affected (0.00 sec)

mysql> select * from larrydb.user;

+------+----------+

| id | name |

+------+----------+

| 1 | larrywen |

| 2 | wentasy |

| 3 | jsutdb |

| 4 | db |

| 5 | test |

+------+----------+

5 rows in set (0.00 sec)

六 参考资料

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/388879.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

从Jupyter Notebook到脚本

16 Aug: My second article: From Scripts To Prediction API8月16日:我的第二篇文章: 从脚本到预测API As advanced beginners, we know quite a lot: EDA, ML concepts, model architectures etc…… We can write a big Jupyter Notebook, click “Re…

加勒比海兔_加勒比海海洋物种趋势

加勒比海兔Ok, here’s a million dollar question: is the Caribbean really dying? Or, more specifically, are marine species found on Caribbean reefs becoming less abundant?好吧,这是一个百万美元的问题:加勒比海真的死了吗? 或者…

tornado 简易教程

引言 回想Django的部署方式 以Django为代表的python web应用部署时采用wsgi协议与服务器对接(被服务器托管),而这类服务器通常都是基于多线程的,也就是说每一个网络请求服务器都会有一个对应的线程来用web应用(如Djang…

人口密度可视化_使用GeoPandas可视化菲律宾的人口密度

人口密度可视化GeoVisualization /菲律宾。 (GeoVisualization /Philippines.) Population density is a crucial concept in urban planning. Theories on how it affects economic growth are divided. Some claim, as Rappaport does, that an economy is a form of “spati…

Unity - Humanoid设置Bip骨骼导入报错

报错如下: 解决: 原因是biped骨骼必须按照Unity humanoid的要求设置,在max中设置如下: 转载于:https://www.cnblogs.com/CloudLiu/p/10746052.html

Kubernetes - - k8s - v1.12.3 OpenLDAP统一认证

1,基本概念 为了方便管理和集成jenkins,k8s、harbor、jenkins均使用openLDAP统一认证。2,部署openLDAP 根据之前的文档,openLDAP使用GFS进行数据持久化。下载对应的openLDAP文件git clone https://github.com/xiaoqshuo/k8s-clust…

srpg 胜利条件设定_英雄联盟获胜条件

srpg 胜利条件设定介绍 (Introduction) The e-sports community has been growing rapidly in the past few years, and what used to be a casual pastime has morphed into an industry projected to generate $1.8 B in revenue by 2022. While there are many video games …

机器学习 综合评价_PyCaret:机器学习综合

机器学习 综合评价Any Machine Learning project journey starts with loading the dataset and ends (continues ?!) with the finalization of the optimum model or ensemble of models for predictions on unseen data and production deployment.任何机器学习项目的旅程都…

silverlight 3D 游戏开发

http://www.postvision.net/SilverMotion/DemoTech.aspx silverlight 3D 游戏开发 时间:2010-10-22 06:33来源:开心银光 作者:黎东海 点击: 562次意外发现一个silverlight的实时3D渲染引擎。性能比开源那些强很多。 而且支持直接加载maya,3Dmax等主流3D模型文件。 附件附上它的…

皮尔逊相关系数 相似系数_皮尔逊相关系数

皮尔逊相关系数 相似系数数据科学和机器学习统计 (STATISTICS FOR DATA SCIENCE AND MACHINE LEARNING) In the last post, we analyzed the relationship between categorical variables and categorical and continuous variables. In this case, we will analyze the relati…

Kubernetes持续交付-Jenkins X的Helm部署

Jenkins X 是一个集成化的 CI / CD 平台,可用于 部署在Kubernetes集群或云计算中心。支持在云计算环境下简单地开发和部署应用。本项目是在Kubernetes上的安装支持工具集。 本工具集中包含: Jenkins - 定制好的流水线和运行环境,完全整合CI/C…

中国石油大学(华东)暑期集训--二进制(BZOJ5294)【线段树】

问题 C: 二进制 时间限制: 1 Sec 内存限制: 128 MB提交: 8 解决: 2[提交] [状态] [讨论版] [命题人:]题目描述 pupil发现对于一个十进制数,无论怎么将其的数字重新排列,均不影响其是不是3的倍数。他想研究对于二进制,是否也有类似的性质。于…

Java 8 新特性之Stream API

1. 概述 1.1 简介 Java 8 中有两大最为重要的改革,第一个是 Lambda 表达式,另外一个则是 Stream API(java.util.stream.*)。 Stream 是 Java 8 中处理集合的关键抽象概念,它可以指定你希望对集合进行的操作&#xff0c…

Ubuntu中NS2安装详细教程

前言: NS2是指 Network Simulator version 2,NS(Network Simulator) 是一种针对网络技术的源代码公开的、免费的软件模拟平台,研究人员使用它可以很容易的进行网络技术的开发,而且发展到今天,它…

14.vue路由脚手架

一.vue路由:https://router.vuejs.org/zh/ 1、定义 let router new VueRouter({mode:"history/hash",base:"基本路径" 加一些前缀 必须在history模式下有效linkActiveClass:"active", 范围选择linkExactActiveClass:"exact&qu…

linux-buff/cache过大导致内存不足-程序异常

2019独角兽企业重金招聘Python工程师标准>>> 问题描述 Linux内存使用量超过阈值,使得Java应用程序无可用内存,最终导致程序崩溃。即使在程序没有挂掉时把程序停掉,系统内存也不会被释放。 找原因的过程 这个问题已经困扰我好几个月…

Android 适配(一)

一、Android适配基础参数1.常见分辨率(px)oppx 2340x1080oppR15 2280x1080oppor11sp 2160*10801080*1920 (主流屏幕16:9)1080*216018:9 手机主流分辨率: 1080*2160高端 16:9 手机主流分辨率: 1080P (1080*1920) 或 2K …

Source Insight 创建工程(linux-2.6.22.6内核源码)

1. 软件设置 安装完Source Insight,需要对其进行设置添加对“.S”汇编文件的支持: 2. 新建linux-2.6.22.6工程 1)选择工程存放的路径: 2)下载linux-2.6.22.6内核源码,并解压。在Source Insight中 指定源码的…

课时20:内嵌函数和闭包

目录: 一、global关键字 二、内嵌函数 三、闭包 四、课时20课后习题及答案 ******************** 一、global关键字 ******************** 全局变量的作用域是整个模块(整个代码段),也就是代码段内所有的函数内部都可以访问到全局…

盛严谨,严谨,再严谨。_评估员工调查的统计严谨性

盛严谨,严谨,再严谨。The human resources industry relies heavily on a wide range of assessments to support its functions. In fact, to ensure unbiased and fair hiring practices the US department of labor maintains a set of guidelines (Uniform Guidelines) to …